Timsen Timsen - 1 year ago 172
AngularJS Question

How to $watch state change of $stateProvider in AngularJS?

I know that I can run:

scope.$watch(someItem, function(){})

But I can't figure out a way to watch over change of
in my application.

Answer Source

It's in the docs: https://github.com/angular-ui/ui-router/wiki#state-change-events

function(event, toState, toParams, fromState, fromParams){ 
    // do something
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download