Description
I use ui-router for handling state management in my application.
In one of my states, the view contains a form for filling data about a Contract and inside that form there is a directive .
The directive contains a search button for opening a modal dialog. Inside that modal, user can search for a person and results are displayed in a paged table. The user can then select one of the results to close the modal and to assign the selected person to the Contract.
This works, but then I want to handle browser history
So the state for the Contract form is defined as followed:
$stateProvider.state('detail.item.edit', {
url: '/edit',
views: {
'@detail': {
templateUrl: 'myModule/views/contract.detail.item.edit.html',
controller: 'contracts.detail.item.ctrl'
}
}
I can't figure out how to add a state for the modal. Plus it is opened from a directive, which makes things trickier. When the modal is closed, the Contract state should not be reloaded either.
Has anyone attempted doing that already ?