Comparability problem in $state.get(toState.name).getState() with ui-router-extras
See original GitHub issueWas anyone successful at using angular permission together with ui-router-extras ( https://github.com/christopherthielen/ui-router-extras )?
I get an exception during angular-permission initialization “TypeError: $state.get(…).getState is not a function” after declaring the dependency on ‘ct.ui.router.extras’ in here:
compensatePermissionMap(statePermissionMap) {
var permissionMap = new PermissionMap({redirectTo: statePermissionMap.redirectTo});
var toStatePath = $state
.get(toState.name)
.getState().path // !!! error here
.slice()
.reverse();
...
It happens for toState.name == ‘login’, my route declaration is following:
# CoffeeScript
angular.module 'myModule'
.config ($stateProvider) ->
$stateProvider
.state "loginModule",
abstract: true
template: "<ui-view/>"
data:
permissions:
only: ['guest']
redirectTo: 'dashboard'
.state "login",
parent: "loginModule"
url: "/login"
templateUrl: "login.html"
controller: "LoginCtrl"
Issue Analytics
- State:
- Created 8 years ago
- Comments:7
Top Results From Across the Web
angular ui-router: get $state info of toState in resolve
I would like to access the state's name and other attributes the app is navigating to using angular ui-router when working on the...
Read more >ui-router extras 0.0.15-pre2 - gists · GitHub
// should create a ui-router state. // The factory function is injected/executed using the runtime $injector. The future-state is injected as 'futureState'.
Read more >Using ui-router to handle states and views for Angular ...
Get the DSR key for this state by calculating the DSRParams option var cfg = getConfig(toState); var key = getParamsString(toParams, cfg.params); var ...
Read more >angular-ui-router | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >State.stateservice - UI-Router
If a callback returns an TargetState, then it is used as arguments to $state.transitionTo() and the result returned. Parameters. fromPath PathNode[]. toState ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, thank you guys, switching these lines in module dependency fixes it:
Oh boy! I’m gonna fix that!