I am attempting to create a method for deleting and adding items to an array, but I need easy-to-use delete and add methods since I am unfamiliar with TypeScript.
export class NgForComponent implements OnInit {
Numbers: number[];
constructor() {
this.Numbers = [1, 2, 3, 4, 5];
}
ngOnInit() {
}
}
HTML
<div>
<ul>
<li *ngFor="let number of Numbers">
{{number}}
</li>
</ul>
</div>
<button >Delete</button>