An open API service indexing awesome lists of open source software.

https://github.com/nikku/ng-simple-dialog

A simple dialog component for AngularJS
https://github.com/nikku/ng-simple-dialog

Last synced: 4 months ago
JSON representation

A simple dialog component for AngularJS

Awesome Lists containing this project

README

          

# ng-simple-dialog

A simple, yet powerful dialog utility for [AngularJS](https://angularjs.org). Based on [simple-dialog](https://github.com/nikku/simple-dialog).

## Usage

Include the module into your application:

```javascript
var myModule = angular.module('myModule', [
require('ng-simple-dialog')
]);
```

Create dialogs anywhere, i.e. in controllers:

```javascript
var dialogTemplate =
'{{ a }} + {{ b }}
' +
'CALCULATE';

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