I can't understand why instead of a placeholder inside my input I see [object Object];
Here is my html:
<div class="input-form">
<input type="text" placeholder="Type name here..." [(ngModel)]="newItem">
<button (click)="addItem()">Add new</button>
</div>
<ul>
<li *ngFor="let item of items">{{ item }}
<button (click)="deleteItem(item)" >Delete</button>
</li>
</ul>
And here is component.ts:
newItem = {};
items = [];
addItem() {
if (this.newItem !== null) {
this.items.push(this.newItem);
this.newItem = {};
}
}