If you're interested in a solution that looks more like AngularJS, take a look at the ngDialog service. This will allow you to embed dialogue features in any controller that he needs. In addition, its openConfirm method will return a promise that will be allowed or rejected depending on how the dialog was closed (perfect for your example, which looks like a confirmation / cancellation dialog).
app.controller('demo', ['$scope', 'ngDialog', function($scope, ngDialog) {
$scope.openDialog = function() {
ngDialog.openConfirm({
templateUrl: 'dialog-template.html',
scope: $scope
}).then(function () {
console.log('confirm');
}).catch(function () {
console.log('cancel');
})
}
}])
Here's the fork of your plunk using ngDialog to create a confirmation / cancellation dialog that is aligned at the top right of the screen.
Updated Plunk with ngDialog
ngDialog GitHub repository and instructions
source
share