ng-simple-dialog

0.1.0 • Public • Published

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

Package Sidebar

Install

npm i ng-simple-dialog

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • nikku