From 10789d2505daca1734ae64ff7f62b2374b1ddb3a Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Thu, 7 Jul 2016 14:35:15 +0800 Subject: [PATCH] added alert2 --- public/assets/wechat/login.html | 2 +- public/assets/wechat/templates/alert2.html | 11 ++++++++ public/javascripts/wechat/directives/alert.js | 28 ++++++++++++++++++- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 public/assets/wechat/templates/alert2.html diff --git a/public/assets/wechat/login.html b/public/assets/wechat/login.html index 309db29de..1283ad281 100644 --- a/public/assets/wechat/login.html +++ b/public/assets/wechat/login.html @@ -22,4 +22,4 @@ - \ No newline at end of file + diff --git a/public/assets/wechat/templates/alert2.html b/public/assets/wechat/templates/alert2.html new file mode 100644 index 000000000..d798ab20f --- /dev/null +++ b/public/assets/wechat/templates/alert2.html @@ -0,0 +1,11 @@ +
+
+
+
{{title}}
+
{{message}}
+
+ 取消 + 确定 +
+
+
diff --git a/public/javascripts/wechat/directives/alert.js b/public/javascripts/wechat/directives/alert.js index f53ecdb5a..e10bd4a0b 100644 --- a/public/javascripts/wechat/directives/alert.js +++ b/public/javascripts/wechat/directives/alert.js @@ -16,4 +16,30 @@ app.directive('myAlert', ['config', function(config){ }; } } -}]); \ No newline at end of file +}]); + +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(); + } + } + } + } +}]);