Issue
I have a timer in my app. If the time is up it's transfer user to login page.
How to detect if the MdDialog is open and close it?
I don't want to use angular.element(document).find('md-dialod').remove()
- because some elements like md-backdrop
or smth else stil exists.
Is there any solutions for this situations?
Solution
Are you using multiple dialog opening customization? This should work:
$timeout(function(){
$mdDialog.cancel();
}, 8000);
Here $mdDialog.cancel()
hides an existing dialog and reject the promise returned from $mdDialog.show()
. And even if it's not open calling it will not cause any error.
https://plnkr.co/edit/9nTJNvpO6qU1Bnq1mVML?p=preview
Answered By - Shantanu
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.