I am trying to show 2 different blocks by tag. but the sub view is not showing up, Here is my code:
I want to use to choose which part I want to show.
$stateProvider
.state('route1', {
url: "/route1",
templateUrl: "route1.html"
})
.state('route1.list', {
url: "/list/:id", //the URL will be: route1/list
views:{
'':{
templateUrl: "route1.list.html",
controller: function($scope,$stateParams){
$scope.items = ["I am", "from", "Insperity", "Items"];
// console.log($stateParams.id);
$scope.parentid=$stateParams;
}
},
'money@route1.list':{
templateUrl:'money.html',
controller: function($scope,$stateParams){
console.log($scope.parentid);
}
},
'details@route1.list':{
templateUrl:'detail.html'
}`enter code here`
}
})
Html for route1.list.html :
<h3>List of Route 1 Items</h3>
<ul>
<li ng-repeat="item in items">{{item}}</li>
</ul>
<a ui-sref="money">go to money</a>
<a ui-sref="details">go to details</a>
<div ui-view></div>
but if I change my html to this: (it works, but not the way I want)
<h3>List of Route 1 Items</h3>
<ul>
<li ng-repeat="item in items">{{item}}</li>
</ul>
<div ui-view='money'></div>
<div ui-view='details'></div>
Any idea about this issue?