Skip to content

Commit

Permalink
build(*): bump version v0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
a8m committed Nov 12, 2014
1 parent 5546834 commit 9d628ff
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Angular-filter   [![Build Status](https://travis-ci.org/a8m/angular-filter.svg?branch=master)](https://travis-ci.org/a8m/angular-filter) [![Coverage Status](https://coveralls.io/repos/a8m/angular-filter/badge.png?branch=master)](https://coveralls.io/r/a8m/angular-filter?branch=master)
>Bunch of useful filters for AngularJS (with no external dependencies!), **v0.5.0**
>Bunch of useful filters for AngularJS (with no external dependencies!), **v0.5.1**
**Notice:** if you want to use `angular-filter` out of AngularJS(e.g: Node, etc..), check [Agile.js repo](https://github.com/a8m/agile)

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-filter",
"version": "0.5.0",
"version": "0.5.1",
"main": "dist/angular-filter.js",
"description": "Bunch of useful filters for angularJS(with no external dependencies!)",
"repository": {
Expand Down
36 changes: 27 additions & 9 deletions dist/angular-filter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Bunch of useful filters for angularJS(with no external dependencies!)
* @version v0.5.0 - 2014-11-12 * @link https://github.com/a8m/angular-filter
* @version v0.5.1 - 2014-11-12 * @link https://github.com/a8m/angular-filter
* @author Ariel Mashraki <[email protected]>
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
Expand Down Expand Up @@ -853,11 +853,6 @@ angular.module('a8m.group-by', [ 'a8m.filter-watcher' ])

var getterFn = $parse(property);

// If it's called outside the DOM
if(!isScope(this)) {
return _groupBy(collection, getterFn);
}
// Return the memoized|| memozie the result
return filterWatcher.isMemoized('groupBy', arguments) ||
filterWatcher.memoize('groupBy', arguments, this,
_groupBy(collection, getterFn));
Expand Down Expand Up @@ -1975,7 +1970,7 @@ angular.module('a8m.wrap', [])
angular.module('a8m.filter-watcher', [])
.provider('filterWatcher', function() {

this.$get = [function() {
this.$get = ['$window', '$rootScope', function($window, $rootScope) {

/**
* Cache storing
Expand All @@ -1991,6 +1986,12 @@ angular.module('a8m.filter-watcher', [])
*/
var $$listeners = {};

/**
* $timeout without triggering the digest cycle
* @type {function}
*/
var $$timeout = $window.setTimeout;

/**
* @description
* get `HashKey` string based on the given arguments.
Expand Down Expand Up @@ -2019,6 +2020,18 @@ angular.module('a8m.filter-watcher', [])
delete $$listeners[id];
}

/**
* @description
* for angular version that greater than v.1.3.0
* if clear cache when the digest cycle end.
*/
function cleanStateless() {
$$timeout(function() {
if(!$rootScope.$$phase)
$$cache = {};
});
}

/**
* @description
* Store hashKeys in $$listeners container
Expand Down Expand Up @@ -2062,8 +2075,13 @@ angular.module('a8m.filter-watcher', [])
var hashKey = getHashKey(filterName, args);
//store result in `$$cache` container
$$cache[hashKey] = result;
//add `$destroy` listener
addListener(scope, hashKey);
// for angular versions that less than 1.3
// add to `$destroy` listener, a cleaner callback
if(isScope(scope)) {
addListener(scope, hashKey);
} else {
cleanStateless();
}
return result;
}

Expand Down
4 changes: 2 additions & 2 deletions dist/angular-filter.min.js

Large diffs are not rendered by default.

Binary file modified dist/angular-filter.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "angular-filter",
"description": "Bunch of useful filters for angularJS(with no external dependencies!)",
"version": "0.5.0",
"version": "0.5.1",
"filename": "angular-filter.min.js",
"main": "dist/angular-filter.min.js",
"homepage": "https://github.com/a8m/angular-filter",
Expand Down

0 comments on commit 9d628ff

Please sign in to comment.