Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Can't invoke one modal after another #943

Closed
tschofen opened this issue Sep 5, 2013 · 2 comments
Closed

Can't invoke one modal after another #943

tschofen opened this issue Sep 5, 2013 · 2 comments

Comments

@tschofen
Copy link

tschofen commented Sep 5, 2013

Trying to use modals in events, but am not able to call two modals one after another.
I set one modal on the $rootScope so I can reuse it and can find it at any given time.

I suspect I'm doing something wrong.

    scope.$on('event:auth-loginRequired', function() {
        $rootScope.modal = $modal.open({
            templateUrl: 'login/login.tpl.html',
            controller: 'LoginCtrl'
        });
    };

    scope.$on('event:auth-loginConfirmed', function() {
        // close first modal -- works just fine
        $rootScope.modal.close('done');

        // Now create a new instance and open it -- but this never happens
        $rootScope.modal = $modal.open({
            templateUrl: 'survey/survey.tpl.html',
            backdrop: false
        });

    };
@pkozlowski-opensource
Copy link
Member

@tschofen if you want us to help you, you will have to provide a minimal reproduce scenario using http://plnkr.co/

@tschofen
Copy link
Author

tschofen commented Sep 5, 2013

Absolutely right. I did cobble a quick plunker together, that proves nothing's wrong with the modal. Sorry to bring it up. I did find the code in my app that interfered with it.

So, perhaps this may help others: http://plnkr.co/edit/TqQ1isSWcGl7BOC8qj3r?p=preview

@tschofen tschofen closed this as completed Sep 5, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants