• 1000 *
component. html
<input type="text" #notes class="form-control" placeholder="Add Notes" name="notes" [(ngModel)]="inputNotes" >
<span class="input-group-text" (click)="addNote(notes.value)">Add</span>
//Search field
<input type="text" #notes class="form-control" placeholder="Add Notes" name="notes" (input)="Search()">
Component.ts
inputNotes: string = ""
notesArray = []
addNote(value) {
if (value !== "") {
this.notesArray.push(value)
}
else {
alert('Field required **')
}
console.log(this.inputNotes)
}
//Search filed
Search(value: string) {
this.notesArray = this.notesArray.filter(res => {
return res.value.match(this.notesArray)
})
}
}
Заранее спасибо