I am trying to dynamically generate a list of inputs and bind their values to a model's array property using AngularJS + jQuery.
...
<section ng-controller="MyController">
<button ng-click="addInput">Add new field</button>
<section class="input-group"></section>
</section>
...
$scope.model = {
'title': 'aaa',
'arr': []
};
$scope.instructionCount = 0;
$scope.addInput = function() {
$model.arr.push('');
$('.input-group').append(
'<input type="text"
ng-bind="$scope.model.arr[' + ++$scope.instructionCount + ']">
);
};
Why doesn't this work?