a8m / a8m/angular-filter

Cache no longer works (angular >= 1.3)

Đang mở
#157 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
2.9k
Fork
319
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hey all,

Because of this line from Angular 1.2:

``` javascript
return fn.apply(self, args);
```

https://github.com/angular/angular.js/blob/g3_v1_2/src/ng/parse.js#L595

Was changed to this line in Angular 1.3:

``` javascript
return fn.apply(undefined, args);
```

https://github.com/angular/angular.js/blob/g3_v1_3/src/ng/parse.js#L568

`this` in all the filters is no longer linked to the scope that called the filter and therefor **filterWatcher** gets `scope=undefined` which causes `isScope(scope)` to always return `false` which in turn causes `cleanStateless()` to get called after every filter call, `cleanStateless()` cleans the cache.

The consequence is major performance issues and slowdown on every $digest cycle (which re-evaluates the filter output even though the input did not change).

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.