I have repeat.forin a user element in my view (giving me a list of UI elements):
<box repeat.for="box of boxes" box.bind="box"></box>
I would like my view model to have a list of custom item models (so I can call validation methods for each of the items in my list.)
I tried this:
<div repeat.for="box of boxes">
<box box.bind="box" view-model.ref="boxViewModels[${$index}]"></box>
</div>
But the property boxViewModelsdoes not add anything to the array. I even tried to see if it would even bind inside repeat.for:
<div repeat.for="box of boxes">
<box box.bind="box" view-model.ref="boxViewModelTesting"></box>
</div>
But after I created several instances, boxViewModelTestingthere is undefined.
It makes me wonder if it will view-model.refwork inside repeat.for.
- , 'repeat.for'?