angularjs - See what states are configured in ui-router -
is there way see of states have been set on $stateprovider
?
in case, state assignments distributed across many files. inspect built states on run
or config
in different file.
for example:
# component1.coffee angular.module('zoo').config ($stateprovider) -> $stateprovider.state 'component1', url: '/component1' template: _template controller: 'component1ctrl' # component2.coffee angular.module('zoo').config ($stateprovider) -> $stateprovider.state 'component2', url: '/component2' template: _template controller: 'component2ctrl' # componentnavigation.coffee angular.module('zoo').run ($state) -> console.log 'all configured states:', $state.configuredstates # doesn't exist.
is there list out 2 states, component1
, component2
?
$state.get()
returns array of states. includes top-level abstract state, can filter out if want.
Comments
Post a Comment