0.1.0 • Published 9 years ago

ng-simple-dialog v0.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

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