I am new to AngularJS and I have a question about how to utilize the ng-repeat feature.
Most examples I find demonstrate reading from a service and then using ng-repeat to loop over that data.
In my scenario, an admin can create an invitation for guests and set a property called:
total_in_party = 4;
Based on the value of "total_in_party", I want to display 3 input fields for each guest in the party.
For example:
<div ng-repeat="guest in party">
<input type="text" ng-model="guest.first_name" />
<input type="text" ng-model="guest.last_name" />
<select ng-model="selectedGuestMeal" ng-options="meal.id as meal.name for meal in meals"></select>
</div>
In this instance, it should generate those 3 input fields 4 times.
I believe I am close, but I am unsure how to create the party object if there is no existing data stored in it?
If I am approaching this problem incorrectly, please do not hesitate to provide guidance!