You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$stateProvider
.state('contacts', {
abstract: true,
//my whole point is to get the id=1 here :(
url: '/contacts/:id',
templateUrl: function($stateParams){
console.log("Did i get the child's parameter here? " + $stateParams.id)
return 'contacts' + $stateParams.id + '.html'; //this will have a ui-view in it which will render its detail.
}
})
.state('contacts.detail', {
url: '/:id',
// loaded into ui-view of parent's template
templateUrl: 'contacts.detail.html',
controller: function($scope, $stateParams){
$scope.person = $scope.contacts[$stateParams.id];
},
onEnter: function(){
console.log("enter contacts.detail");
}
})
})
in view:
<a ui-sref="contacts.detail({id: 1})">My first contact<a>
Any help is deeply appreciated.
The text was updated successfully, but these errors were encountered:
I want to access the url parameter($stateParam) inside a abstract state while calling a child state. I am curious to know how that can be done. http://plnkr.co/edit/L0TXx3DCBOJmh4XydXbV?p=preview
in view:
<a ui-sref="contacts.detail({id: 1})">My first contact<a>
Any help is deeply appreciated.
The text was updated successfully, but these errors were encountered: