AngularJs : How to know if an URL's change is from adress bar or from component action

38 Views Asked by At

I'm creating an AngularJs web app and I need to know if an user enter an url in the address bar. In this case I will destroy the current context to initiate a new one. I tried to use the $rootScope.$on('$locationChangeSuccess', function (event, newUrl, oldUrl) {}); function but it seems there is no way to differenciate if the change comes from the user who entered a url in the adress bar or if it comes from a action in the apge (button, link, enter on a form, ...). Can I differenciate both case ? Or should I re-think my URL handling (Any suggestion) ?

0

There are 0 best solutions below