Collection repeat with ng-if

Hi,

There is a requirement that in the collection repeat the records with hidden:true property should not be saved. So, I tried using ng-if and I ended with an error:

TypeError: Cannot set property 'webkitTransform' of undefined

and

TypeError: clone[0].removeAttribute is not a function

But when I use ng-repeat, it works. Has anyone else faced this problem? What is the solution?

Thanks,

Gaurav

yes i am too facing same problem. Can someone help on this please.

do you mean with “saved” the caching?
collection-repeat needs this hidden elements to show the correct entries (fast enough, e.g. while scrolling) and to be sure that there are enough list-entries in the viewport.

With ng-repeat it works because there are no additional list entries.

I used class to hide the list item instead of ng-if.

Hi @gaurav_ch have you found the solution for this?
I am facing the same problem.
Thanks

Found the solution!
Instead of using ng-if, I use a filter.
See the answer here

2 Likes