Answer the question
In order to leave comments, you need to log in
How to track the change of @Input variable in the component?
Good afternoon,
There is a component, it has an input parameter
In the component, the elements of this array are associated with the form like this@Input() SafetyIncidents: Array<SafetyIncident>;
<mat-form-field class="col-md-1">
<input name=SafetyIncidentImpactId [(ngModel)]="Incident.ImpactId" matInput placeholder="Impact ID">
</mat-form-field>
addSafetySection() {
this.SafetyIncidents.push(new SafetyIncident());
// console.log("add new incedent");
}
Answer the question
In order to leave comments, you need to log in
everything is in the documentation
https://angular.io/guide/component-interaction#int...
Oh, and more
addSafetySection() {
this.SafetyIncidents = this.SafetyIncidents.concat(new SafetyIncident());
// console.log("add new incedent");
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question