vendredi 22 septembre 2017

Redirecting route - what is ember way?

In my app, I require to user to not use the back button of the browser on the last page. For that I find a way to replacing existing url with current page url. so user will stay with same page.

I am using this JS code :

init(){//writing at init

        history.pushState(null, null, document.URL);
        window.addEventListener('popstate', function () {
            history.pushState(null, null, document.URL);
        });
    },

But what is the correct code of ember to replace the above code? what is the correct way to do?

thanks in advance.




Aucun commentaire:

Enregistrer un commentaire