Skip to content

how do you handle state for a modal dialog ?  #123

Closed
@graphicsxp

Description

@graphicsxp

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions