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

Binding fails with ng-repeat and <select> #905

Closed
jmbe opened this issue Apr 25, 2012 · 4 comments
Closed

Binding fails with ng-repeat and <select> #905

jmbe opened this issue Apr 25, 2012 · 4 comments

Comments

@jmbe
Copy link

jmbe commented Apr 25, 2012

  1. Open http://jsfiddle.net/2JWb2/5/
  2. Select a value in one of the three top select boxes
  3. Problem: model "selections" does not get updated.

Possibly related:

  1. Click reset values in same fiddle
  2. Choose a value in the second set of selects
  3. Problem: The sibling select will also get updated with the selected value (but the model is correctly updated)
@IgorMinar
Copy link
Contributor

we are going to investigate and address this in one of the upcoming 1.0.x releases.

thanks for a really good example.

@IgorMinar
Copy link
Contributor

@zhenbzha
Copy link
Contributor

zhenbzha commented Sep 5, 2012

3 use cases are in http://jsfiddle.net/2JWb2/5/ 1,2 don't work, 3 works.

2nd use case seems related to #933. Test with the fix submitted for #933 and it works. see: http://jsfiddle.net/zhenbzha/2JWb2/40/. Fix is merged already.

1st use case, looks like scope issue. Is it a valid use case to put ngRepeat & ngOptions in one element. Does Angular want to support it?

http://jsfiddle.net/andytjoslin/DeD5h/5/ is fixed as well. see: http://jsfiddle.net/zhenbzha/LTXVm/1/

@mhevery
Copy link
Contributor

mhevery commented Sep 6, 2012

1st use case works as intended, but it is very confusing. When you do ng-repeat="selection in selections" then ng-model="selection" will bind the select to the selection property of the current scope. There are three scopes for the three items in the array, so you are binding them there, and hence not back to the original item.

2nd use cases is fixed and will be merged to master soon

3rd works

So I am closing this issue as resolved.

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

No branches or pull requests

4 participants