AngularJs-ui modal 封装 dialog

时间:2023-03-09 20:33:23
AngularJs-ui modal  封装 dialog

常常在操作中和用户进行交互,及时反馈操作结果;用到alert 和confrim 功能 找到一个基于anguarjs-ui的modal,方便我们使用

angular-dialog-service

注意要引入

Angular JS ngSanitize - http://code.angularjs.org/1.2.1/angular-sanitize.min.js

ngSanitize: http://docs.angularjs.org/api/ngSanitize (needed for ng-bind-html)

参见官方实例

使用 confirm , 针对选择 yes 和选择no 的方法

 var dlg = $dialogs.confirm('Please Confirm','Is this awesome or what?');
dlg.result.then(function(btn){
//yes callback
$scope.confirmed = 'You thought this quite awesome!';
},function(btn){
//no callback
$scope.confirmed = 'Shame on you for not thinking this is awesome!';
});