diff --git a/angular-flash.js b/angular-flash.js index 5d3fa8d..7b98375 100755 --- a/angular-flash.js +++ b/angular-flash.js @@ -29,7 +29,9 @@ angular.module('flash', []) return text ? [{ level: level, text: text }] : [asMessage(level)]; }; - var flash = function(level, text) { + var flash = function(level, text, timeout) { + if (timeout !== undefined) + $timeout(function() { emit(cleanup); }, timeout); emit(messages = asArrayOfMessages(level, text)); }; @@ -55,4 +57,4 @@ angular.module('flash', []) }]; return directive; -}]); \ No newline at end of file +}]);