小编use*_*445的帖子

Angular UI Router - 嵌套路由不适用于具有嵌套状态的模板

这是我的代码:

.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>
Run Code Online (Sandbox Code Playgroud)

当我点击链接时,在ui-view中出现了父状态的模板和控制器.AngularJS版本是1.2.0-rc.2

javascript angularjs angular-ui angular-ui-router

10
推荐指数
1
解决办法
6284
查看次数