角度 UI 路由器 - 嵌套路由不适用于具有嵌套状态的模板
Angular UI Router - nested routes does not work on templates with nested state
这是我的代码:
.state('profile',{
url : '/profile',
templateUrl: 'views/user.html',
controller: 'UserCtrl'
})
.state('profile.forgot',{
url : '/delivers',
templateUrl: 'views/user_forgot.html', <- this template not appear, when state is active
controller: 'forgotCtrl'
})
<a ui-sref="profile.forgot">Forgot your pasword?</a>
<div class="panel" ui-view=""></div>
当我单击链接时,在 ui-view 中出现了父状态的模板和控制器。AngularJS版本是1.2.0-rc.2
嵌套状态将在其父模板的ui-view
元素中呈现(如果没有父模板,则在根ui-view
中呈现)。请务必阅读文档的"嵌套状态和视图"部分。
请注意亲子命名约定!
.state('profile.forgot',{
url : '/forgot',
templateUrl: 'views/profile.forgot.html',
controller: 'forgotCtrl'
})
相关文章:
- 带有嵌套状态的Angular ui路由器和后退按钮
- Angularjs:ui路由嵌套状态下的绑定不起作用
- 嵌套状态的多个视图
- 使用 Object.asassign 正确返回嵌套状态
- Ui 路由器 AngularJs 嵌套状态和嵌套视图正确
- 角度路由器不选择子状态(嵌套状态)
- 在Redux中更新嵌套状态的更干净/更短的方法
- 重新加载嵌套状态,而不是具有 url 参数 ui 路由器的父级
- 角度 UI 路由器 - 嵌套路由不适用于具有嵌套状态的模板
- 嵌套状态 URL 在 angular-ui-router 中不正确
- AngularJS中具有嵌套状态的嵌套视图
- 有角度的路由器嵌套状态不继承自定义数据
- 如何在Angular ui路由器中使用嵌套状态下的多个视图
- 如何在React中复制对象之间的嵌套状态
- 从嵌套状态访问不同的父控制器
- 嵌套状态(角度ui)的父作用域未启动
- 在ui-router中设置抽象嵌套状态的默认子节点
- AngularJs的ui-router ui-sref不能从嵌套状态中生成带有参数的href
- 用Angular UI路由器高亮显示活动的嵌套状态
- AngularJS UI-Router——无法获得嵌套状态来显示模板