Here's my template, I am dynamically creating input elements to be used in a form. When I submit the form nothing is passed to the update()
function designated on the submit element as nothing appears to bound to the scope. I have tried track by id, $index and whatnot. The user input choices should be saved as an array property on the item object.
Is creating elements with nested ng-repeats like this possible in Angular or should I be looking at some additional library like formly etc.
<div data-ng-controller="ViewTemplateController">
<form novalidate>
<ul>
<li data-ng-repeat="optionCat in templateData.optionCats track by optionCat._id">
<h3>{{optionCat.text}}</h3>
<ul>
<li data-ng-repeat="option in optionCat.optionz track by option._id">
<label><h4>{{option.text}} This is a sample</h4></label>
<input ng-if="(option.typeOf.indexOf('textBox')>-1)" type="text" ng-model="item.col[$index].textInput" />
<select ng-if="(option.typeOf.indexOf('dropDown')>-1)">
<option ng-model="item.col[$index].value_id" ng-repeat="value in option.valueList track by value._id" value="{{value._id}}">
{{value.text}}
</option>
</select>
</li>
</ul>
</li>
</ul>
<input type="submit" ng-click="update(item)" value="Save" />
</form>