-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bindonce repeater #10
Comments
Yes it makes sense, I've been thinking a lot about creating bo-repeat in order to get rid of the watcher but not only for that, a repeater uses one watcher ($watchCollection as you said) but what makes it expensive in term of performances is the creation of a child scope for each item, in case of large set can be costly. Now bo-* fields can live without child scopes because once the item is drawn even if the scope change it is no longer bound with the scope, but if you use any ng-* field inside the bo-repeater you immediately run into scope issues. |
👍. I found many cases in my websites where I'd need to use that. |
👍 It would be one of the most useful cases, especially when grids loop through rows and columns. |
👍 |
1 similar comment
👍 |
👍 |
I need this in my life. But mostly, I need it in my code... Pasvaz, any time you spend towards making this a reality would be much appreciated :) |
Hi @MWallenberg, this will be the next step, right now I'm focusing on the rebind feature, when the new binding system will work flawlessy it shouldn't be a problem to implement a repeater. |
+1, would be awesome to have |
👍 |
1 similar comment
👍 |
👍 looking forward to this feature |
👍 |
1 similar comment
+1 |
I believe that Angular 1.3 solves this problem, like so: <li ng-repeat="item in ::items">{{::item.name}}</li> |
akarelas, I looked at Angular 1.3 documentation and don't see any mention of the syntax you posted. Where do get that from? |
@michael-wynn I don't know where I learned it from (maybe from the Changelog of Angular 1.3) but it works. |
Thank you! From: Lorenz Hübschle-Schneider [mailto:[email protected]] @michael-wynn https://github.com/michael-wynn @akarelas https://github.com/akarelas https://docs.angularjs.org/guide/expression#one-time-binding — |
In fact, I replaced bindonce with Angular one-time bindings in Glowing Bear yesterday: glowing-bear/glowing-bear#418 It started with adding |
ng-repeat registers a collection watcher (with $watchCollection), which can be costly, especially when considering ng-repeat based recursive directives (as in http://jsfiddle.net/n8dPm/).
I was wondering if a bindonce type repeater would make sense. That repeater would wait for the collection to be there, but wouldn't shallow-watch the collection.
Not sure it makes sense. Feel free to close this issue if it doesn't. Thanks.
The text was updated successfully, but these errors were encountered: