From your question, you want to delete the line when you click the delete button. In Angular, you must remove the entry from the model. Therefore, for this, simply pass the line identifier for something unique to the ng controller and remove it from the model.
So, if you have something like below
<td *ngFor="#lev of rubric?.criteria[0].levels">
<button class="close removeLevel" ng-click="onClickRemove($index)">×</button>
<input type="text" class="form-control" placeholder="Performance Level"
#level="ngForm"
[(ngModel)]="lev.level"
ngControl="level"
/>
</td>
in the controller
$scope.onClickRemove=function(index)
{
rows.splice(index, 1);
}
source
share