In my Angular2 app, I am using a *ngFor
loop to display model names retrieved from JSON data.
The main template code structure is as follows:
<div *ngFor="#model of datajson.models">
<models [data]="model"></models>
</div>
Now, in the child component, the code appears like this:
@Component({
selector: 'models',
template: `
{{data.modelname}}
<input type="text" class="txt-dev-number" [(ngModel)]="devCount"/>
`,
The last line in the component displays a text box for each model name where users can input numbers. My question is how to calculate the total sum of all the values entered in these text boxes.