If I simplify my situation, I have a list of numbers which I want the user to be able to add to. They are being displayed as a list of HTML input boxes and I want there to be an extra, empty row at the bottom which will be added to the list as soon as it's used. Any ideas?
I've tried this, but obviously there's nothing linking the second include into the numbers array.
$scope.numbers = [1,1,2,3];
Which is displayed with:
<ul>
<ng-include src="'row.html'" ng-repeat="number in numbers"></ng-include>
<ng-include src="'row.html'"></ng-include>
</ul>
<script type="text/ng-template" "id="row.html">
<li><input type="number" ng-model="number" /></li>
</script>
EDIT:
I don't know why I'm having a hard time explaining this :P I'm imagining 5 inputs for the data above, 4 containing the numbers above and a fifth which is empty (and potentially differently styled, eg. slightly transparent) As soon as a number is typed into the empty fifth input - say, the number 5 - then the list has an extra element so it reads [1,1,2,3,5] and there are now 6 inputs on the page, the last of which is empty and slightly transparent.
The aim is to allow people to be able to add a new row of data without there being an "add new row" button. Does that make sense?