I have an array that I am trying to check for null values. If there are any, I would like to remove them from the array. Here is my code and attempt.
this.existingSavings = [{
value: null,
sourceId: null,
fund: null
}];
changeSavingsAmount(): void {
for(let i = 0; i < this.existingSavings.length; i++) {
if(this.existingSavings[i].value == null) {
//not sure what to do here
}
}
}
<div *ngFor="let source of existingSavings; let i = index;" class="row">
<div class="col-4">
<div class="input-container">
<label for="savings">Existing savings value</label>
<input id="savings" [(ngModel)]="existingSavings[i].value" (blur)="changeSavingsAmount()" type="number"
placeholder="R">
</div>
</div>
</div>