这是我的代码:
.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 中出现了父状态的模板和 Controller 。 AngularJS 版本为 1.2.0-rc.2
最佳答案
嵌套状态将在其父模板的 ui-view
元素内呈现(如果没有父模板,则在根 ui-view
内呈现)。请务必阅读“Nested States & Views” ' 文档部分。
关于javascript - Angular UI Router - 嵌套路由不适用于具有嵌套状态的模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19055367/