I'm trying to dynamically create a form for an array of users and per user show their available options.
so far so good. the problem is that depending on the selection of one option, an extra textinput needs to be shown and attached to the option itself.
how should I "ng-model" that extra option? when i try to use user.SelectedOption[option.Id].ExtraInfo the inputfield becomes disabled.
anyone got an idea (or a better solution)?
<div ng-repeat="user in users">
<h1>{{user.UserName}}</h1>
<table>
<tr ng-repeat="options in user.Options>
<th>{{option.Name}}</th>
<td><input type="checkbox" ng-model="user.SelectedOption[option.Id]" /><td>
<td>
<p ng-show="user.SelectedOption[option.Id] === true">
<label>Remarks</label>
<input type="text" ng-model="????" >
</p>
</td>
</tr>
<td>
</table>
</div>
<button type="primary" ng-click="save()">save<button>
Aucun commentaire:
Enregistrer un commentaire