angular-css
angular-css copied to clipboard
Support for UI-Router 1.x
As a User, I'd like to have native support for angular-ui-router#1.x so that I don't have to use workarounds that mimic angular-ui-router#0.x's deprecated behavior.
Cause
- With ui-router 1.x the emission of
$stateChangeXXXevents were removed, for state load it now uses the methodonEnterfrom the$transitionProvideron the config phase (oronEnteron state configuration).
AC
- User should be able to use
angular-csswhile usingangular-ui-router#1.xwithout need for manual workaround.
Note
- The workaround below could be used in the
configphase of your module, although it's not the most desirable solution.
var previousState;
$transitionsProvider.onEnter({}, function(trans, state) {
var $rootScope = trans.injector().get('$rootScope');
$rootScope.$emit('$stateChangeSuccess', state, null, previousState);
previousState = state;
});