加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – 查看在ui-router中配置的状态

发布时间:2020-12-17 08:43:58 所属栏目:安全 来源:网络整理
导读:有没有办法看到已经设置在$ stateProvider的所有状态? 在这种情况下,我希望我的状态分配分布在许多文件。我想检查在运行或配置在不同的文件中构建的状态。 例如: # component1.coffeeangular.module('zoo').config ($stateProvider) - $stateProvider.sta
有没有办法看到已经设置在$ stateProvider的所有状态?

在这种情况下,我希望我的状态分配分布在许多文件。我想检查在运行或配置在不同的文件中构建的状态。

例如:

# 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.

有什么东西会列出两个状态,component1和component2?

$ state.get()

返回所有状态的数组。包括顶级抽象状态,但你可以过滤掉,如果你想要的。

How to enumerate registered states in ui-router?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读