I am aware of basic two-way binding in angular 2, as shown in the docs.
I have an persons array that I use to create an html list:
Now, when I click on a person’s line, I can edit it using two-way binding:
<form>
<label>Name: </label>
<input [(ngModel)]="selectedPerson.name" name="name"/>
<label>Description: </label>
<input [(ngModel)]="selectedPerson.job" name="job"/>
</form>
Now I want the 2-way link the list itself: (The list is in a different view than the line editor)
<div class='row' *ngFor="let person of model">
<div class='col'>{{person.name}}</div>
<div class='col'>{{person.job}}</div>
</div>
I am currently using *ngForto list all individuals. If mine modelis an array of two people, I get two rows. There are times when it modelcan change by 3 or 4 people. Is there any way to make angular detect this and add lines accordingly? [(ngModel)]doesn't seem to be applicable here.
, , . model ngFor ?