I have a product list page, there have list of products,when click the particular products, call the function and in the function state.go.
Not working in dynami
The way the parameters are defined in your url is incorrect. Anyway, one option is to use the lifecycle methods and return a target
.state('home.product.detail', {
url: '/products/?productID&?brand&?store',
params:{
'productID': {
value: "redminote4",
squash: true
}
'brand': {
value: "x",
squash: true
},
'store': {
value: "amazon",
squash: true
}
},
data: {
displayName: '',
displayImg: 'Images/productsHeaderIcon.png'
},
onEnter: ['$transition$', '$state$', 'LoginHome', function(transition, state, LoginHome){
if(!transition.options().resolvedParams){
return transition.router.stateService.target(
transition.to().name,
{
productID: 'redminote4',
brand: 'x',
store:'amazon'
},
{
resolvedParams: true
}
);
}
}]
This interrupts the state change and replaces it with your new target which now is populated with your parameters and has a custom key in the options object that I'm using in this example to not redirect the state change again.
You can learn more about the lifecycle here and the TargetState we return here