-
Notifications
You must be signed in to change notification settings - Fork 27.4k
feat(ngBindOnce) && feat{ngRepeatOnce} Bind to the DOM once with no watchers #5408
Comments
+1 |
or, alternatively, a way to suspend and re-enable watches. |
+1 |
2 similar comments
+1 |
+1 |
I have been trying to figure out how to add labels after creating an issue. Thank you greatly! |
+1 |
+1 |
7 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
the enable/disable variant could be great |
+1 |
6 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
While Disable/Enable might be nice, I don't think it is necessary. It would be easy enough to wrap the DOM element in an ngSwitch or ngIf to deal with the on/off. Same with nested repeats -- if the first ngRepeat is a normal one and the nested ngRepeats are bindOnce, one can have static content that still changes when the program tells it. In short, I think that it may be nice to have the enable/disable feature, but if it is easier to just have an ngBindOnce without the enable/disable feature, then don't worry about it and possibly add it in the future if it is needed. |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
5 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
a way to suspend and re-enable watches would be a great addition to this. for example stock ticker with push data. |
+1 I'd like to see this in Angular as well. I'm currently using Pasvaz's Bindonce and it works perfectly. |
We currently use bindonce and this: http://blog.scalyr.com/2013/10/31/angularjs-1200ms-to-35ms/ |
…ngular#5408 Signed-off-by: Josh Kurz <[email protected]>
…ngular#5408 Signed-off-by: Josh Kurz <[email protected]> fix(ngBindOnceDirsSpec.js): testing everything Signed-off-by: Josh Kurz <[email protected]>
+1 |
Please check out #6354 for a better alternative proposal to bind-once |
…ngular#5408 Signed-off-by: Josh Kurz <[email protected]> fix(ngBindOnceDirsSpec.js): testing everything Signed-off-by: Josh Kurz <[email protected]>
+1 |
+1 |
1 similar comment
+1 |
+1 |
Expressions that start with `::` will be binded once. The rule that binding follows is that the binding will take the first not-undefined value at the end of a $digest cycle. Watchers from $watch, $watchCollection and $watchGroup will automatically stop watching when the expression(s) are bind-once and fulfill. Watchers from text and attributes interpolations will automatically stop watching when the expressions are fulfill. All directives that use $parse for expressions will automatically work with bind-once expressions. E.g. <div ng-bind="::foo"></div> <li ng-repeat="item in ::items">{{::item.name}};</li> Paired with: Caitlin and Igor Design doc: https://docs.google.com/document/d/1fTqaaQYD2QE1rz-OywvRKFSpZirbWUPsnfaZaMq8fWI/edit# Closes angular#7486 Closes angular#5408
This feature should include:
This feature would allow a developer to:
It is for data that:
The text was updated successfully, but these errors were encountered: