Looking to pass two values to a new ui-view via parameters:
- item id
- list of objects
However, I want the new view to display only the id in the browser URL and not the stringified array of objects:
http://www.myapp.com/#/my-view/4
INSTEAD OF
http://www.myapp.com/#/my-view/4?flskdjalfjaewoijoijasdlfkjösldakjföliwejöorijo
Is there a way to either a) pass the array of objects hidden to the ui-view or b) pass both but hide one from the browser URL?
I came across information about the squash parameter, but was unable to achieve the desired outcome.
Below is my current view setup:
$stateProvider
.state('show', {
url: "/show/{itemId}?{itemList}",
views: {
'mainView': {
templateUrl: 'views/itemView.html',
controller: 'showController',
params: {
itemList: {
value: null,
squash: true
},
itemId: -1
}
}
}
How can I keep the list of objects hidden from the URL while displaying the id?