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
console.log is called twice.
It doesn't happen when using views property on state though :
state('contacts.detail', {
// parent: 'contacts',
url: '/{contactId}',
resolve: {
something: function() {
console.log('only called once');
}
},
views: {
'': {
templateUrl: 'contacts.detail.html',
controller:
[ '$scope', '$stateParams', 'something',
function ($scope, $stateParams, something) {
$scope.something = something;
$scope.contact = findById($scope.contacts, $stateParams.contactId);
}],
},
'hint@': {
template: 'This is contacts.detail populating the view "hint@"',
},
'menu': {
templateProvider:
[ '$stateParams',
function ($stateParams){
// This is just to demonstrate that $stateParams injection works for templateProvider
// $stateParams are the parameters for the new state we're transitioning to, even
// though the global '$stateParams' has not been updated yet.
return '<hr><small class="muted">Contact ID: ' + $stateParams.contactId + '</small>';
}],
},
},
})
The text was updated successfully, but these errors were encountered:
Using the sample app you provide :
console.log is called twice.
It doesn't happen when using views property on state though :
The text was updated successfully, but these errors were encountered: