Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

one-time binding ng-options #10687

Closed
jhudzik opened this issue Jan 8, 2015 · 5 comments
Closed

one-time binding ng-options #10687

jhudzik opened this issue Jan 8, 2015 · 5 comments

Comments

@jhudzik
Copy link

jhudzik commented Jan 8, 2015

According to docs, when using a directive that takes an expression, we are able set one-time binding as so:
`

  • {{item.name}};
`

However, this doesn't seem to work with ng-options, tried (1.3.0 - 1.38)
ng-options="o as o for o in ::things"

If I place ::things in a binding it works.
ng-options="o as o for o in {{::things}}"

@lgalfaso
Copy link
Contributor

lgalfaso commented Jan 8, 2015

can you please create a plunker that shows this issue? Thanks!

@jhudzik
Copy link
Author

jhudzik commented Jan 8, 2015

@lgalfaso
Copy link
Contributor

lgalfaso commented Jan 8, 2015

Ok, I am able to reproduce this and know what is wrong

@lgalfaso lgalfaso self-assigned this Jan 8, 2015
lgalfaso added a commit to lgalfaso/angular.js that referenced this issue Jan 8, 2015
Preserve the $watchDelegate on the watcher used to detect changes on
the labels

Closes angular#10687
@Narretz Narretz modified the milestones: 1.3.9, 1.4.x Jan 9, 2015
lgalfaso added a commit to lgalfaso/angular.js that referenced this issue Jan 9, 2015
Preserve the $watchDelegate on the watcher used to detect changes on
the labels

Closes angular#10687
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Jan 12, 2015
Utilize the $watchDelegate on the watcher used to detect changes to the labels.

Closes angular#10687
Closes angular#10694
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Jan 12, 2015
Utilize the $watchDelegate on the watcher used to detect changes to the labels.

Closes angular#10687
Closes angular#10694
@AliAdravi
Copy link

Why cannot we use
ng-options="::o as o for o in things"
It is working for me.

@petebacondarwin
Copy link
Contributor

I am not sure if this will provide a performance benefit as the expression things will continue to be evaluated, even though the actual option expression is one time bound.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.