Reputation: 101
Here is my code:
.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>
When i click on link, in ui-view appeared template and controller of parent state. AngularJS version is 1.2.0-rc.2
Upvotes: 10
Views: 6356
Reputation: 518
Please Pay attention to parent-child naming convention!
.state('profile.forgot',{
url : '/forgot',
templateUrl: 'views/profile.forgot.html',
controller: 'forgotCtrl'
})
Upvotes: -2
Reputation: 1237
A nested state will render within the ui-view
element of its parent template (which, if parentless, renders within the root ui-view
). Make sure you read the 'Nested States & Views' section of the docs.
Upvotes: 7