Angular 1.3 stateless filter caching doesn't work with nightly


#1

Hi

Angular 1.3 has a great feature where they cache the result of a stateless filter. Works perfectly as you can see on the attached jsbin. But somehow it doesn’t work in ionic. See the attached codepen.

Without Ionic: When button is clicked, filters are not recalculated and therefore no console log is printet
With Ionic: When button is clicked, filters are recalculated as you can see in console log

Expected (see console log):

Ionic (see console log):


#2

When I update your codepen to use the nightly builds from the cdn //code.ionicframework.com/nightly/js/ionic.bundle.js the filter doesn’t recalculate every time and add more console logs. Is this what you mean? Thanks


#3

Hi Adam

Thank you. It works with the nightly.

It still didn’t work on my local repo thought and it took me ages to find out why. The reason is batarang.

When you open the jsbin above in preview mode (you have to clone first since the free time is expired) with chrome, open the console you’ll see it works as supposed.

When you then enable batarang it doesn’t work anymore. Couldn’t yet figure out why.

Chris


#4

There is already an open issue: https://github.com/angular/angularjs-batarang/issues/140