added alert2

This commit is contained in:
guange 2016-07-07 14:35:15 +08:00
parent 373e3d3422
commit 10789d2505
3 changed files with 39 additions and 2 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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();
}
}
}
}
}]);