socialforge/public/javascripts/wechat/directives/alert.js

67 lines
1.7 KiB
JavaScript
Raw Normal View History

2016-06-17 18:18:03 +08:00
app.directive('myAlert', ['config', function(config){
return {
templateUrl: config.rootPath+ 'templates/alert.html',
scope: {
title: "=",
message: "=",
visible: "=",
cb: "="
2016-06-17 18:18:03 +08:00
},
link: function(scope){
scope.dismiss = function(){
2016-06-20 16:04:38 +08:00
scope.visible = false;
if(typeof scope.cb === 'function'){
scope.cb();
}
2016-06-17 18:18:03 +08:00
};
}
}
2016-07-07 14:35:15 +08:00
}]);
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;
};
scope.confirm = function(){
scope.visible = false;
if(typeof scope.cb === 'function'){
scope.cb();
}
}
}
}
}]);
app.directive('myAlert3', ['config', function(config){
return {
templateUrl: config.rootPath+ 'templates/alert3.html',
scope: {
title: "=",
message: "=",
visible: "=",
cb: "=",
invite: "="
},
link: function(scope){
scope.dismiss = function(){
scope.visible = false;
};
scope.confirm = function(){
scope.visible = false;
if(typeof scope.cb === 'function'){
scope.cb();
}
}
}
}
}]);