SD Dev
SD Dev

Reputation: 345

Listen for a state change of AngularUI Router

I want to know if a user is going to a specific state, and I plan on using ng-animate to make it slide in.

Is there a way listen to an event that will pass the state that user clicked/changed and then append a class to the <ui-view>?

Upvotes: 0

Views: 852

Answers (1)

Tome Pejoski
Tome Pejoski

Reputation: 1582

Sure. You can listen to the State Change Events, $stateChangeStart in your case.

Create the handler function for this event and inside add the CSS class to your element.

Upvotes: 1

Related Questions