Confirmation dialog on ng-click using Angular Material Services - AngularJS
Answers
Rahul M...
4960
Points
31
Posts
|
Use $mdDialog.confirm() . Also you can follow https://material.angularjs.org/latest/demo/dialog $scope.openConfirmationDialog = function() {
// Appending dialog to document.body to cover sidenav in docs app
var confirm = $mdDialog.confirm()
.title('Would you like to delete your debt?')
.textContent('All of the banks have agreed to forgive you your debts.')
.ariaLabel('Lucky day')
.ok('Please do it!')
.cancel('Sounds like a scam');
$mdDialog.show(confirm).then(function() {
$scope.status = 'You decided to get rid of your debt.';
}, function() {
$scope.status = 'You decided to keep your debt.';
});
};
Posted On:
11-Jan-2017 05:06
|