Skip to content Skip to sidebar Skip to footer

Documentation On Angular Material $mddialog.finally?

From the documentation, dialog boxes in Angular Material have a signature like so: function showAlert() { alert = $mdDialog.alert() .title('Attention, ' + $scope.userName)

Solution 1:

$mdDialog.show() returns a promise. finally is an action that you take on completion of a promise, regardless of if it was resolved or rejected. Typically, finally is used to handle whatever cleanup should be done once the promise has completed (just like it does here by clearing the alert variable).

Angular uses the q library to handle promises, so you can find information on the finally() method at the Q API Reference

Post a Comment for "Documentation On Angular Material $mddialog.finally?"