【发布时间】:2016-10-27 04:59:21
【问题描述】:
我在angularjs中使用ui-router,我有以下代码:
在blog.module.js
$stateProvider
.state('blog', {
url: '/domains/:domain_id/blog',
template: '<ui-view></ui-view>',
title: 'Blog',
})
.state('blog.posts', {
url: '/posts',
template: 'Hello world',
title: 'Posts',
});
和modules.module.js
$stateProvider
.state('modules', {
url: '/domains/:domain_id/modules',
templateUrl: '/assets/templates/modules/index.tpl.html',
controller: 'ModulesCtrl as index',
title: 'Módulos',
});
所有路线中的:domain_id 在我的应用程序中引用了相同的东西。但如果可能的话,我需要/想要使这个:domain_id 持续所有状态更改,而无需在我使用的每个ui-sref 上传递它。
我不知道怎么做,有人知道吗?
非常感谢您的关注
【问题讨论】:
标签: javascript angularjs angular-ui-router ui-sref