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

Angularjs 1.5.8 - radio button list inside 2 levels of ng-repeat not working properly #15022

Closed
JithuTholoor opened this issue Aug 13, 2016 · 3 comments

Comments

@JithuTholoor
Copy link

JithuTholoor commented Aug 13, 2016

Please check the below code.
http://plnkr.co/edit/gTmgOPR4jJFM1armkTL2?p=preview

I was trying to achieve a pair of radio button inside 2 levels of ng-repeat. I can check the radio button, the values changes as expected. But if the values are assigned from control, only last pair of radio button get updated. When I change the version to 1.2.0, it works fine.

posted the same on stack overflow - http://stackoverflow.com/questions/38919278/angularjs-1-5-8-radio-button-list-inside-2-levels-of-ng-repeat-not-working-pro

@gkalpak
Copy link
Member

gkalpak commented Aug 17, 2016

This is expected behavior when you have multiple inputs with the same name. (You don't need this in Angular anyway.)

See #15009 for more info.

@JithuTholoor
Copy link
Author

JithuTholoor commented Aug 25, 2016

I hope you have noticed that, the names are not same for all radio buttons. it is same only for a group.
Well, i found a solution for my issue. - Instead of giving name as driverGender{{$index}}{{$parent.$index}}, created function which return the same.

@gkalpak
Copy link
Member

gkalpak commented Aug 25, 2016

I hope you have noticed that, the names are not same for all radio buttons

I have. My previous comment is still valid. There are some implications when using the same name in multiple controls in Angular. Make sure to take a look at #15009 for more info.

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

2 participants