From c3b1c0ce3624fa982cf91fc722d8a79a237fc820 Mon Sep 17 00:00:00 2001 From: Michael Pope Date: Thu, 12 Sep 2013 13:01:40 +1000 Subject: [PATCH 1/2] Add a timeout to clear message automatically feature --- angular-flash.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/angular-flash.js b/angular-flash.js index 3e5c096..9eea495 100755 --- a/angular-flash.js +++ b/angular-flash.js @@ -29,7 +29,8 @@ angular.module('flash', []) return text ? [{ level: level, text: text }] : [asMessage(level)]; }; - return function(level, text) { + return function(level, text, timeout) { + $timeout(function() { emit(cleanup); }, timeout); emit(messages = asArrayOfMessages(level, text)); }; }) @@ -49,4 +50,4 @@ angular.module('flash', []) }; return directive; -}); \ No newline at end of file +}); From 38581452f58a5efab246f266ea831bc64273c5ed Mon Sep 17 00:00:00 2001 From: Michael Pope Date: Thu, 26 Sep 2013 16:33:58 +1000 Subject: [PATCH 2/2] Add ability to include html in your flash messages --- angular-flash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-flash.js b/angular-flash.js index 9eea495..4911a76 100755 --- a/angular-flash.js +++ b/angular-flash.js @@ -39,7 +39,7 @@ angular.module('flash', []) var directive = { restrict: 'E', replace: true }; directive.template = '
    ' + - '
  1. {{m.text}}
  2. ' + + '
  3. ' + '
'; directive.controller = function($scope, $rootScope) {