Skip to content

Commit 9d628ff

Browse files
committed
build(*): bump version v0.5.1
1 parent 5546834 commit 9d628ff

File tree

6 files changed

+32
-14
lines changed

6 files changed

+32
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#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)
2-
>Bunch of useful filters for AngularJS (with no external dependencies!), **v0.5.0**
2+
>Bunch of useful filters for AngularJS (with no external dependencies!), **v0.5.1**
33
44
**Notice:** if you want to use `angular-filter` out of AngularJS(e.g: Node, etc..), check [Agile.js repo](https://github.com/a8m/agile)
55

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-filter",
3-
"version": "0.5.0",
3+
"version": "0.5.1",
44
"main": "dist/angular-filter.js",
55
"description": "Bunch of useful filters for angularJS(with no external dependencies!)",
66
"repository": {

dist/angular-filter.js

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Bunch of useful filters for angularJS(with no external dependencies!)
3-
* @version v0.5.0 - 2014-11-12 * @link https://github.com/a8m/angular-filter
3+
* @version v0.5.1 - 2014-11-12 * @link https://github.com/a8m/angular-filter
44
* @author Ariel Mashraki <[email protected]>
55
* @license MIT License, http://www.opensource.org/licenses/MIT
66
*/
@@ -853,11 +853,6 @@ angular.module('a8m.group-by', [ 'a8m.filter-watcher' ])
853853

854854
var getterFn = $parse(property);
855855

856-
// If it's called outside the DOM
857-
if(!isScope(this)) {
858-
return _groupBy(collection, getterFn);
859-
}
860-
// Return the memoized|| memozie the result
861856
return filterWatcher.isMemoized('groupBy', arguments) ||
862857
filterWatcher.memoize('groupBy', arguments, this,
863858
_groupBy(collection, getterFn));
@@ -1975,7 +1970,7 @@ angular.module('a8m.wrap', [])
19751970
angular.module('a8m.filter-watcher', [])
19761971
.provider('filterWatcher', function() {
19771972

1978-
this.$get = [function() {
1973+
this.$get = ['$window', '$rootScope', function($window, $rootScope) {
19791974

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

1989+
/**
1990+
* $timeout without triggering the digest cycle
1991+
* @type {function}
1992+
*/
1993+
var $$timeout = $window.setTimeout;
1994+
19941995
/**
19951996
* @description
19961997
* get `HashKey` string based on the given arguments.
@@ -2019,6 +2020,18 @@ angular.module('a8m.filter-watcher', [])
20192020
delete $$listeners[id];
20202021
}
20212022

2023+
/**
2024+
* @description
2025+
* for angular version that greater than v.1.3.0
2026+
* if clear cache when the digest cycle end.
2027+
*/
2028+
function cleanStateless() {
2029+
$$timeout(function() {
2030+
if(!$rootScope.$$phase)
2031+
$$cache = {};
2032+
});
2033+
}
2034+
20222035
/**
20232036
* @description
20242037
* Store hashKeys in $$listeners container
@@ -2062,8 +2075,13 @@ angular.module('a8m.filter-watcher', [])
20622075
var hashKey = getHashKey(filterName, args);
20632076
//store result in `$$cache` container
20642077
$$cache[hashKey] = result;
2065-
//add `$destroy` listener
2066-
addListener(scope, hashKey);
2078+
// for angular versions that less than 1.3
2079+
// add to `$destroy` listener, a cleaner callback
2080+
if(isScope(scope)) {
2081+
addListener(scope, hashKey);
2082+
} else {
2083+
cleanStateless();
2084+
}
20672085
return result;
20682086
}
20692087

dist/angular-filter.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-filter.zip

551 Bytes
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-filter",
33
"description": "Bunch of useful filters for angularJS(with no external dependencies!)",
4-
"version": "0.5.0",
4+
"version": "0.5.1",
55
"filename": "angular-filter.min.js",
66
"main": "dist/angular-filter.min.js",
77
"homepage": "https://github.com/a8m/angular-filter",

0 commit comments

Comments
 (0)