addFieldValue() {
this.newarray= this.fieldArray.push(this.newAttribute)
console.log(this.newarray);
this.newAttribute = {};
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.10/angular.min.js"></script>
<td>
<input [(ngModel)]="field.SourceIP" class="form-control" type="text" name="{{field.SourceIP}}" />
</td>
<button mat-button (click)="addFieldValue()">Add More Rule
<i class="material-icons custom">add</i>
</button>
addFieldValue() {
this.newarray= this.fieldArray.push(this.newAttribute)
console.log(this.newarray);
this.newAttribute = {};
}
deleteFieldValue(index: number) {
this.fieldArray.splice(index, 1);
}
当我在表中添加动态行时,我看不到该行的先前数据。我正在使用Angular 6?
点击添加后,我在此处输入数据添加行后,我丢失了以前的数据