i try to make a nested view in my app. This is how I try, I have parent UI-view
<div class="ui-view-container col-lg-offset-2 col-lg-10 col-md-offset-2 col-md-10 col-sm-12 col-xs-12" ng-cloak>
<div ui-view></div>
</div>
where I change all state on my web app. For example, this is one state
.state('distributorItem', {
url: '/distributorItem',
templateUrl: 'distributorItem.html',
controller: 'distributorItem',
authentication: {roles: ["distributor"]}
})
Inside this state, I want to make another MENU, where user can select item and find information by ID, below is example how I pass ID params and add child UI-view
<table class="table-hover">
<thead>
<tr>
<th>Item ID</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="(key, value) in itemIdInClientDetail">
<td><a ui-sref="client/info/{{value.id}}">{{value.id}}</a></td>
</tr>
</tbody>
</table>
<div class="col-lg-11 col-md-11 col-sm-10 col-xs-12">
<div ui-view></div>
</div>
There is child state
.state('distributorItem.client/info/:itemID', {
url: '/client/info/:itemID',
templateUrl: 'clientItemInfo.html',
controller: 'clientItemInfo',
authentication: {roles: ["distributor"]}
})
And this not working, because I get this error in console
angular.js:12477 Error: Could not resolve 'client/info/1126' from state 'distributorItem'
Pls, help... thnx
EDIT:
I make a change like @Maxim Shoustin answered. Now state changed, but in child navigation when I click on item, parent ui-view is full refreshed (child navigation and ui-view) not only child
now my state looks like this
.state('client', {
url: '/client/info/:itemID',
templateUrl: 'clientInfo.html',
controller: 'detailControllerClient as vm',
})
.state('client.detail', {
url: '/detail/:itemID',
templateUrl: 'itemInfoById.html',
controller: 'detailControllerClient as vm',
})
And html is here. (infoDisplay.html is parent view inside index.html. This ui-view in code bellow is child view (client.detail)) infoDisplay.html
<div class="new_nav col-lg-1 col-md-1 col-sm-2 col-xs-12">
<table class="table-hover">
<thead>
<tr>
<th>item ID</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="(key, value) in clientDetail">
<td><a ui-sref=".detail({'itemID': value.id})">{{value.id}}</a></td>
</tr>
</tbody>
</table>
</div>
<div ui-view></div>