<ul *ngFor="let i of arr">
<li>{{i}}</li>
</ul>
<input [(ngModel)]="a">
<button (click)="add()">add</button>
a:string="";
arr:string[]=['apple','pear','orange'];
constructor() { }
add():void{
if(this.a!=""){
this.arr.push(this.a)
}else {
return
}
}