diff --git a/angular-flash.js b/angular-flash.js index 3e5c096..4911a76 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)); }; }) @@ -38,7 +39,7 @@ angular.module('flash', []) var directive = { restrict: 'E', replace: true }; directive.template = '
    ' + - '
  1. {{m.text}}
  2. ' + + '
  3. ' + '
'; directive.controller = function($scope, $rootScope) { @@ -49,4 +50,4 @@ angular.module('flash', []) }; return directive; -}); \ No newline at end of file +});