RafaelVidaurre/angular-permission

Need to import stateEvents to make it works

Closed this issue · 1 comments

I found that the angular-permission-ui relied on the event "stateChangeStart" of ui-route, but this event is deprecated, and not fired since v1.0.

To make this module works, we have to include "stateEvents" as below:
import uiRouter from 'angular-ui-router';
import 'angular-ui-router/release/stateEvents';
import {permission, uiPermission} from 'angular-permission';

angular.module('app', [
uiRouter,
'ui.router.state.events',
permission,
uiPermission,
....
])

Reference: angular-ui/ui-router#2720

The page now works, but a error message will be shown when visiting pages:
"TransitionRejection(type: 3, message: The transition has been aborted, detail: Hook aborted transition)"

That is right the polyfil was created for that purpose. When the angular-permission will be rewritten to angular2 we will deprecate need for polyfils.