angular-css icon indicating copy to clipboard operation
angular-css copied to clipboard

Support for UI-Router 1.x

Open karudedios opened this issue 9 years ago • 0 comments

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 $stateChangeXXX events were removed, for state load it now uses the method onEnter from the $transitionProvider on the config phase (or onEnter on state configuration).

AC

  • User should be able to use angular-css while using angular-ui-router#1.x without need for manual workaround.

Note

  • The workaround below could be used in the config phase 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;
});

karudedios avatar Aug 02 '16 19:08 karudedios