On my product list page, there is a list of products. When I click on a particular product, a function is called that uses state.go.
Issue with dynamic functionality:
$state.go('home.product.detail', { 'productID': "redminote4", 'brand': 'x', "store":"amazon" });
.state('home.product.detail', {
url: '/products/:?productID?brand?store',
views: {
'@': {
templateUrl: baseUrl + 'products/products',
controller: 'productsController'
}
},
data: {
displayName: '',
displayImg: 'Images/productsHeaderIcon.png'
}, resolve: {
param2: function (LoginHome) {
return LoginHome.getHomeService1();
}
}
**
The expected web URL output should be:
productID=redminote4&brand=amazon&store=amazon:
Another issue is that the value is retrieved in stateparams: e.g.) stateparams.productId=redminote but the URL is not constructed **
Functioning correctly:
When I set the values in the params, I am able to get the desired output URL as mentioned above:
**function call:**
$state.go('home.product.detail', {
'productID': "redminote4", 'brand': 'x', "store":"amazon" });
App:
.state('home.product.detail', {
url: '/products/:?productID?brand?store',
params:{
'productID': "redminote4",
'brand': 'x',
"store":"amazon" }
},
views: {
'@': {
templateUrl: baseUrl + 'products/products',
controller: 'productsController'
}
},
data: {
displayName: '',
displayImg: 'Images/productsHeaderIcon.png'
}, resolve: {
param2: function (LoginHome) {
return LoginHome.getHomeService1();
}
}
Why is the URL not being formed dynamically?