added alert2
This commit is contained in:
parent
373e3d3422
commit
10789d2505
|
@ -22,4 +22,4 @@
|
|||
</form>
|
||||
</div>
|
||||
|
||||
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
|
||||
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<div class="weui_dialog_confirm" ng-show="visible">
|
||||
<div class="weui_mask"></div>
|
||||
<div class="weui_dialog">
|
||||
<div class="weui_dialog_hd"><strong class="weui_dialog_title">{{title}}</strong></div>
|
||||
<div class="weui_dialog_bd">{{message}}</div>
|
||||
<div class="weui_dialog_ft">
|
||||
<a class="weui_btn_dialog default" ng-click="dismiss()">取消</a>
|
||||
<a class="weui_btn_dialog primary" ng-click="confirm()">确定</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -16,4 +16,30 @@ app.directive('myAlert', ['config', function(config){
|
|||
};
|
||||
}
|
||||
}
|
||||
}]);
|
||||
}]);
|
||||
|
||||
app.directive('myAlert2', ['config', function(config){
|
||||
return {
|
||||
templateUrl: config.rootPath+ 'templates/alert2.html',
|
||||
scope: {
|
||||
title: "=",
|
||||
message: "=",
|
||||
visible: "=",
|
||||
cb: "="
|
||||
},
|
||||
link: function(scope){
|
||||
scope.dismiss = function(){
|
||||
scope.visible = false;
|
||||
if(typeof scope.cb === 'function'){
|
||||
scope.cb();
|
||||
}
|
||||
};
|
||||
scope.confirm = function(){
|
||||
scope.visible = false;
|
||||
if(typeof scope.cb === 'function'){
|
||||
scope.cb();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
|
Loading…
Reference in New Issue