Skip to content

Commit

Permalink
fix(stateFilters): mark state filters as stateful. closes #1479
Browse files Browse the repository at this point in the history
angular 1.3. added a perf enhancement where filters must be stateless, or mark themselves as stateful.
  • Loading branch information
christopherthielen committed Oct 31, 2014
1 parent f86e8ef commit a00b353
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/stateFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
*/
$IsStateFilter.$inject = ['$state'];
function $IsStateFilter($state) {
return function(state) {
var isFilter = function (state) {
return $state.is(state);
};
isFilter.$stateful = true;
return isFilter;
}

/**
Expand All @@ -25,9 +27,11 @@ function $IsStateFilter($state) {
*/
$IncludedByStateFilter.$inject = ['$state'];
function $IncludedByStateFilter($state) {
return function(state) {
var includesFilter = function (state) {
return $state.includes(state);
};
includesFilter.$stateful = true;
return includesFilter;
}

angular.module('ui.router.state')
Expand Down

1 comment on commit a00b353

@KOBA789
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.