I had asked a question about How to associate objects as models using ng-options in angularjs.
And I got an awesome answer very fast. My followup questions is that the response uses <select mutiple>
to handle the child object array.
You can see a working example of what I want, working with <select>
at http://plnkr.co/edit/FQQxrSE89iY1BnfumK0A?p=preview
How can I use <input type='checkbox'>
(instead of <select>
) to handle that object array i.e. ng:model="shirt.colors"
while repeating the items from colors
object array.
The reason, this appears so complicated to me is that I have to manage an array of objects instead of array of values... for example, if you look in the fiddle, there are color
objects and shirt
object that has multiple colors.
If the color
object changes, it should change the corresponding color
objects in shirt
objects.
Thank you in advance.