ngdialog
v0.0.3
Published
##### angular dialog only takes care of show & hide
Downloads
21
Readme
ngdialog
angular dialog only takes care of show & hide
Usage
angular.module('app', ['ng-ui'])
.controller('rootCtrl', ['ngDialog', fucntion(ngDialog) {
ngDialog.show({
templateUrl: '/data/html/modal.html',
controller: function() {
this.title = 'hello';
this.content = 'world';
this.onConfirm = function() {
// do something
};
this.onCancel = function() {
// do something else
};
},
controllerAs: 'modal'
});
}]);
<section>
<header ng-bind="modal.title"></header>
<div ng-bind="modal.content"></div>
<footer>
<button ng-click="modal.onConfirm()">Confirm</button>
<button ng-click="modal.onCancel()">Cancel</button>
</footer>
</section>
API
| name | type | info | | ---- | ---- | ---- | | templateUrl | STRING | 模版路径 (仅支持 absUrl) | | controller | FUNCTION | 模版 controller | | controllerAs | STRING | 模版 alias | | parentElement | DOM | 可选参数,模版容器 (未指定则用 body) | | template | STRING | 模版 html |
LICENSE
MIT