ng-simple-dialog
v0.1.0
Published
A simple angular dialog directive
Downloads
9
Readme
ng-simple-dialog
A simple, yet powerful dialog utility for AngularJS. Based on simple-dialog.
Usage
Include the module into your application:
var myModule = angular.module('myModule', [
require('ng-simple-dialog')
]);
Create dialogs anywhere, i.e. in controllers:
var dialogTemplate =
'{{ a }} + {{ b }} <br/>' +
'<button ng-click="dialog.close(a + b)">CALCULATE</button>';
function MyController($scope, ngSimpleDialog) {
var data = {
a: 'A',
b: 'B'
};
this.openDialog = function() {
var dialog = ngSimpleDialog({
template: dialogTemplate,
scope: data
});
dialog.open(function(resultValue) {
data.resultValue = resultValue;
});
};
}
License
MIT