declare var alertify:any;
export class ExamplComponent implements OnInit {
itemList = []
deleteItem(idx) {
alertify.confirm('Are you sure delete this record.', function() {
this.itemList.slice(idx,1);
})
}
}
html Page
< div *ngFor="let item of itemList;let indx = index" style="text-align: center">
<button class="text-btn text-danger" (click)="deleteItem(indx)" ><i class="fa fa-trash"></i></button>
</div>
Source Library: https://alertifyjs.com/confirm.html
Error Message
ERROR TypeError: Cannot read property 'itemList' of undefined