I have an application with two states. State1 has no modal dialog box, and State2 has a custom modal box. If I click the browser back button when the State2 modal window is up, it'll take me back to the previous state, State1. I don't want this (because if you open and close the modal multiple times, the browser will go back for all of these). Removing the URL in the UI router takes care of that problem, but I have another one.
I need to send multiple parameters through to the states, but apparently it will only let me send one. I have the following state.
.state('state2',{
params: {id: NaN, type: "empty"},
views:{
'modalContent':{
templateUrl: 'templates/modal-content-super-region.html',
controller: 'ModalStatesCtrl'
}
}
})
And the following directive:
<a ui-sref="state2({id: 1, type: 'someStringHere'})">The link</a>
When I console log $stateParams, I get the following:
{ id: 1, type: "empty"}
So directive is passing in the id correctly but not setting the type at all, with the passed in type still remaining at it's default value. Is there anything I can do? Without a URL (which I definitely can't have) can I only pass in one state parameter?