angular-flash-alert
Advanced tools
Comparing version 2.0.0 to 2.1.0
{ | ||
"name": "angular-flash-alert", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"homepage": "https://github.com/sachinchoolur/angular-flash", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -34,3 +34,3 @@ $.fn.putCursorAtEnd = function () { | ||
// Demo controller | ||
var app = angular.module('demoApp', ['flash', 'ngAnimate']); | ||
var app = angular.module('demoApp', ['ngFlash', 'ngAnimate']); | ||
app.controller('FlashDemoCtrl', ['$rootScope', '$scope', 'Flash', '$timeout', function ($rootScope, $scope, Flash, $timeout) { | ||
@@ -37,0 +37,0 @@ $scope.success = function () { |
@@ -1,2 +0,2 @@ | ||
/*! angular-flash - v2.0.0 - 2016-02-01 | ||
/*! angular-flash - v2.1.0 - 2016-02-05 | ||
* https://github.com/sachinchoolur/angular-flash | ||
@@ -6,7 +6,7 @@ * Copyright (c) 2016 Sachin; Licensed MIT */ | ||
/*! angular-flash - v2.0.0 - 2016-01-17 | ||
/*! angular-flash - v2.1.0 - 2016-02-05 | ||
* https://github.com/sachinchoolur/angular-flash | ||
* Copyright (c) 2016 Sachin; Licensed MIT */ | ||
var app = angular.module('flash', []); | ||
var app = angular.module('ngFlash', []); | ||
@@ -13,0 +13,0 @@ app.run(['$rootScope', function ($rootScope) { |
@@ -1,4 +0,4 @@ | ||
/*! angular-flash - v2.0.0 - 2016-02-01 | ||
/*! angular-flash - v2.1.0 - 2016-02-05 | ||
* https://github.com/sachinchoolur/angular-flash | ||
* Copyright (c) 2016 Sachin; Licensed MIT */ | ||
"use strict";var app=angular.module("flash",[]);app.run(["$rootScope",function(a){return a.flashes=[]}]),app.directive("dynamic",["$compile",function(a){return{restrict:"A",replace:!0,link:function(b,c,d){return b.$watch(d.dynamic,function(d){return c.html(d),a(c.contents())(b)})}}}]),app.directive("closeFlash",["$compile","$rootScope","Flash",function(a,b,c){return{link:function(a,d,e){return d.on("click",function(){var a=parseInt(e.closeFlash,10);c.dismiss(a),b.$apply()})}}}]),app.directive("flashMessage",["Flash",function(a){return{restrict:"E",scope:{duration:"=duration"},template:'<div ng-show="$root.flashes.length > 0"><div role="alert" ng-repeat="flash in $root.flashes track by $index" class="alert {{flash.addClass}} alert-{{flash.type}} alert-dismissible alertIn alertOut "> <span dynamic="flash.text"></span> <button type="button" class="close" close-flash="{{flash.id}}"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> </div></div>',link:function(b,c,d){a.setDefaultTimeout(b.duration)}}}]),app.factory("Flash",["$rootScope","$timeout",function(a,b){function c(b){return a.flashes.findIndex(function(a){return a.id===b})}var d={},e=0;return d.setDefaultTimeout=function(a){d.defaultTimeout=a},d.getDefaultTimeout=function(){return d.defaultTimeout},d.create=function(c,f,g,h){var i=void 0,j=void 0;i=this,j={type:c,text:f,addClass:h,id:e++},d.defaultTimeout&&"undefined"==typeof g?j.timeout=d.defaultTimeout:g&&(j.timeout=g),a.flashes.push(j),j.timeout&&(j.timeoutObj=b(function(a){i.dismiss(a)},j.timeout,!0,j.id))},d.pause=function(c){a.flashes[c].timeoutObj&&b.cancel(a.flashes[c].timeoutObj)},d.dismiss=function(b){var e=c(b);-1!==e&&(d.pause(e),a.flashes.splice(e,1),a.$digest())},d.clear=function(){for(;a.flashes.length>0;)d.dismiss(0)},d.reset=d.clear,d}]); | ||
"use strict";var app=angular.module("ngFlash",[]);app.run(["$rootScope",function(a){return a.flashes=[]}]),app.directive("dynamic",["$compile",function(a){return{restrict:"A",replace:!0,link:function(b,c,d){return b.$watch(d.dynamic,function(d){return c.html(d),a(c.contents())(b)})}}}]),app.directive("closeFlash",["$compile","$rootScope","Flash",function(a,b,c){return{link:function(a,d,e){return d.on("click",function(){var a=parseInt(e.closeFlash,10);c.dismiss(a),b.$apply()})}}}]),app.directive("flashMessage",["Flash",function(a){return{restrict:"E",scope:{duration:"=duration"},template:'<div ng-show="$root.flashes.length > 0"><div role="alert" ng-repeat="flash in $root.flashes track by $index" class="alert {{flash.addClass}} alert-{{flash.type}} alert-dismissible alertIn alertOut "> <span dynamic="flash.text"></span> <button type="button" class="close" close-flash="{{flash.id}}"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> </div></div>',link:function(b,c,d){a.setDefaultTimeout(b.duration)}}}]),app.factory("Flash",["$rootScope","$timeout",function(a,b){function c(b){return a.flashes.findIndex(function(a){return a.id===b})}var d={},e=0;return d.setDefaultTimeout=function(a){d.defaultTimeout=a},d.getDefaultTimeout=function(){return d.defaultTimeout},d.create=function(c,f,g,h){var i=void 0,j=void 0;i=this,j={type:c,text:f,addClass:h,id:e++},d.defaultTimeout&&"undefined"==typeof g?j.timeout=d.defaultTimeout:g&&(j.timeout=g),a.flashes.push(j),j.timeout&&(j.timeoutObj=b(function(a){i.dismiss(a)},j.timeout,!0,j.id))},d.pause=function(c){a.flashes[c].timeoutObj&&b.cancel(a.flashes[c].timeoutObj)},d.dismiss=function(b){var e=c(b);-1!==e&&(d.pause(e),a.flashes.splice(e,1),a.$digest())},d.clear=function(){for(;a.flashes.length>0;)d.dismiss(0)},d.reset=d.clear,d}]); |
{ | ||
"name": "angular-flash-alert", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Flash message for AngularJS and Bootstrap", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,6 +0,6 @@ | ||
/*! angular-flash - v2.0.0 - 2016-01-17 | ||
/*! angular-flash - v2.1.0 - 2016-02-05 | ||
* https://github.com/sachinchoolur/angular-flash | ||
* Copyright (c) 2016 Sachin; Licensed MIT */ | ||
const app = angular.module('flash', []); | ||
const app = angular.module('ngFlash', []); | ||
@@ -7,0 +7,0 @@ app.run([ |
@@ -9,3 +9,3 @@ describe('Unit testing angular flash', function() { | ||
// Load the myApp module, which contains the directive | ||
beforeEach(module('flash')); | ||
beforeEach(module('ngFlash')); | ||
@@ -12,0 +12,0 @@ // Store references to $rootScope and $compile |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1428
0
139799