SD Dev SD Dev - 1 year ago 72
AngularJS Question

Angular UI-router, is there a way to append class to <ui-view> based on $state.go?

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 for what state the user clicked/changed to and then append a class?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download