angular-flash-alert
Advanced tools
Comparing version
{ | ||
"name": "angular-flash-alert", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"homepage": "https://github.com/sachinchoolur/angular-flash", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -0,0 +0,0 @@ # Contributing |
@@ -1,2 +0,2 @@ | ||
/*! angular-flash - v1.0.0 - 2015-03-18 | ||
/*! angular-flash - v1.0.0 - 2015-03-19 | ||
* https://github.com/sachinchoolur/angular-flash | ||
@@ -8,3 +8,3 @@ * Copyright (c) 2015 Sachin; Licensed MIT */ | ||
app.run(function($rootScope) { | ||
app.run(['$rootScope', function($rootScope) { | ||
// initialize variables | ||
@@ -16,6 +16,6 @@ $rootScope.flash = {}; | ||
$rootScope.hasFlash = false; | ||
}); | ||
}]); | ||
// Directive for compiling dynamic html | ||
app.directive('dynamic', function($compile) { | ||
app.directive('dynamic', ['$compile', function($compile) { | ||
return { | ||
@@ -31,6 +31,6 @@ restrict: 'A', | ||
}; | ||
}); | ||
}]); | ||
// Directive for closing the flash message | ||
app.directive('closeFlash', function($compile, Flash) { | ||
app.directive('closeFlash', ['$compile', 'Flash', function($compile, Flash) { | ||
return { | ||
@@ -43,6 +43,6 @@ link: function(scope, ele) { | ||
}; | ||
}); | ||
}]); | ||
// Create flashMessage directive | ||
app.directive('flashMessage', function($compile, $rootScope) { | ||
app.directive('flashMessage', ['$compile', '$rootScope', function($compile, $rootScope) { | ||
return { | ||
@@ -56,3 +56,3 @@ restrict: 'A', | ||
}; | ||
}); | ||
}]); | ||
@@ -59,0 +59,0 @@ app.factory('Flash', ['$rootScope', '$timeout', |
@@ -1,4 +0,4 @@ | ||
/*! angular-flash - v1.0.0 - 2015-03-18 | ||
/*! angular-flash - v1.0.0 - 2015-03-19 | ||
* https://github.com/sachinchoolur/angular-flash | ||
* Copyright (c) 2015 Sachin; Licensed MIT */ | ||
!function(){"use strict";var a=angular.module("flash",[]);a.run(function(a){a.flash={},a.flash.text="",a.flash.type="",a.flash.timeout=5e3,a.hasFlash=!1}),a.directive("dynamic",function(a){return{restrict:"A",replace:!0,link:function(b,c,d){b.$watch(d.dynamic,function(d){c.html(d),a(c.contents())(b)})}}}),a.directive("closeFlash",function(a,b){return{link:function(a,c){c.on("click",function(){b.dismiss()})}}}),a.directive("flashMessage",function(a,b){return{restrict:"A",template:'<div role="alert" ng-show="hasFlash" class="alert {{flash.addClass}} alert-{{flash.type}} alert-dismissible ng-hide alertIn alertOut "> <span dynamic="flash.text"></span> <button type="button" class="close" close-flash><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> </div>',link:function(a,c,d){b.flash.timeout=parseInt(d.flashMessage,10)}}}),a.factory("Flash",["$rootScope","$timeout",function(a,b){var c,d={};return d.create=function(d,e,f){var g=this;b.cancel(c),a.flash.type=d,a.flash.text=e,a.flash.addClass=f,b(function(){a.hasFlash=!0},100),c=b(function(){g.dismiss()},a.flash.timeout)},d.pause=function(){b.cancel(c)},d.dismiss=function(){b.cancel(c),b(function(){a.hasFlash=!1})},d}])}(); | ||
!function(){"use strict";var a=angular.module("flash",[]);a.run(["$rootScope",function(a){a.flash={},a.flash.text="",a.flash.type="",a.flash.timeout=5e3,a.hasFlash=!1}]),a.directive("dynamic",["$compile",function(a){return{restrict:"A",replace:!0,link:function(b,c,d){b.$watch(d.dynamic,function(d){c.html(d),a(c.contents())(b)})}}}]),a.directive("closeFlash",["$compile","Flash",function(a,b){return{link:function(a,c){c.on("click",function(){b.dismiss()})}}}]),a.directive("flashMessage",["$compile","$rootScope",function(a,b){return{restrict:"A",template:'<div role="alert" ng-show="hasFlash" class="alert {{flash.addClass}} alert-{{flash.type}} alert-dismissible ng-hide alertIn alertOut "> <span dynamic="flash.text"></span> <button type="button" class="close" close-flash><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> </div>',link:function(a,c,d){b.flash.timeout=parseInt(d.flashMessage,10)}}}]),a.factory("Flash",["$rootScope","$timeout",function(a,b){var c,d={};return d.create=function(d,e,f){var g=this;b.cancel(c),a.flash.type=d,a.flash.text=e,a.flash.addClass=f,b(function(){a.hasFlash=!0},100),c=b(function(){g.dismiss()},a.flash.timeout)},d.pause=function(){b.cancel(c)},d.dismiss=function(){b.cancel(c),b(function(){a.hasFlash=!1})},d}])}(); |
@@ -0,0 +0,0 @@ 'use strict'; |
{ | ||
"name": "angular-flash-alert", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Flash message for angularjs", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -6,2 +6,3 @@  | ||
# angular-flash | ||
A simple lightweight flash message module for angularjs. | ||
@@ -11,3 +12,3 @@ | ||
---------------- | ||
[angular-flash](http://sachinchoolur.github.io/angular-flash/), [jsfiddle](http://jsfiddle.net/sachin377/1azz4xya/) | ||
[angular-flash](http://sachinchoolur.github.io/angular-flash/) | [jsfiddle](http://jsfiddle.net/sachin377/1azz4xya/) | [codepen](http://codepen.io/sachinchoolur/pen/vEyyjZ) | ||
@@ -79,4 +80,4 @@ | ||
``` | ||
#### [guidelines for contributors](https://github.com/sachinchoolur/angular-flash-alert/blob/master/contributing.md) | ||
#### [guidelines for contributors](https://github.com/sachinchoolur/angular-flash/blob/master/contributing.md) | ||
#### MIT © [Sachin](https://twitter.com/sachinchoolur) | ||
#### MIT © [Sachin](https://twitter.com/sachinchoolur) |
@@ -5,3 +5,3 @@ (function() { | ||
app.run(function($rootScope) { | ||
app.run(['$rootScope', function($rootScope) { | ||
// initialize variables | ||
@@ -13,6 +13,6 @@ $rootScope.flash = {}; | ||
$rootScope.hasFlash = false; | ||
}); | ||
}]); | ||
// Directive for compiling dynamic html | ||
app.directive('dynamic', function($compile) { | ||
app.directive('dynamic', ['$compile', function($compile) { | ||
return { | ||
@@ -28,6 +28,6 @@ restrict: 'A', | ||
}; | ||
}); | ||
}]); | ||
// Directive for closing the flash message | ||
app.directive('closeFlash', function($compile, Flash) { | ||
app.directive('closeFlash', ['$compile', 'Flash', function($compile, Flash) { | ||
return { | ||
@@ -40,6 +40,6 @@ link: function(scope, ele) { | ||
}; | ||
}); | ||
}]); | ||
// Create flashMessage directive | ||
app.directive('flashMessage', function($compile, $rootScope) { | ||
app.directive('flashMessage', ['$compile', '$rootScope', function($compile, $rootScope) { | ||
return { | ||
@@ -53,3 +53,3 @@ restrict: 'A', | ||
}; | ||
}); | ||
}]); | ||
@@ -56,0 +56,0 @@ app.factory('Flash', ['$rootScope', '$timeout', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
123958
0.63%81
2.53%