Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4868

How to prevent route changing and show browser prompt

$
0
0

I have upgraded my application from Ember 2.13 to 3.18 and I’ve fixed mostly all changes. But there is an issue with preventing changing the route.

My old code was look like:

`currentPathDidChange: function () {
var that = this;
schedule('afterRender', this, function () {
  if (that.currentRouteName === 'userform') {
    window.onbeforeunload = function () {
      return 'Changes that you made may not be saved.';
    };
  }
}); }.observes('currentPath')`

How to handle it with new Ember?

3 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 4868

Trending Articles