There is a situation where clicking on a link should change the route and send some parameters to another state.
The problem arises when the parameters appear to be empty when logged in the other state.
<div ng-repeat="items in vm.Items">
<a ng-click="vm.goToDetails(items.id)">{{items.title}}</a>
</div>
Controller:
vm.goToDetails = function(Id) {
$state.go('Details', {
'fid': Id
});
}
Route:
$stateProvider.state('Details', {
url: '/details/:fid',
resolve: {
selectedProduct: ['$state', '$stateParams',
function($state, $stateParams) {
console.log($stateParams.fid) //empty string returned
console.log($state.params.fid) //undefined returned
}
]
}
});
Any assistance on this matter would be highly valued and appreciated.