How to see what states are configured in AngularJS / UI-Router?

后端 未结 2 1396
我在风中等你
我在风中等你 2021-01-01 08:36

Is there a way to see all of the states that have been set on $stateProvider?

In this case, I would like my state assignments to be distributed across m

相关标签:
2条回答
  • 2021-01-01 09:06

    $state.get()

    returns an array of all states. Includes the top-level abstract state, but you can filter that out if you want.

    How to enumerate registered states in ui-router?

    0 讨论(0)
  • 2021-01-01 09:15

    For people who try to get actual URL routes including properly displayed nested states:

    $state.get().map(function(state) { return $state.href(state.name) })
    
    // => ['/login', '/home', '/something']
    
    0 讨论(0)
提交回复
热议问题