Hi all,
I have a input field which triggers some part in the .ts file, all is ok but I noticed that when I submit the input the typed text is not cleared:
html form:
<form >
<ion-item>
<ion-label>Nodig:</ion-label>
<ion-input ngController="alert" [(ngModel)]="title" name="title"></ion-input>
</ion-item>
<button ion-button (click)="onSubmit()" name="add" block>Toevoegen</button>
</form>
ts file:
onSubmit(title) {
this.todoService.add(this.title, []).subscribe(
response => {
let todo: Todo = {
name: this.title,
done: false,
tags: []
};
this.todos.unshift(todo)
}
);
}
I guess I forget something and it is very simple but maybe somebody can help