problem
How to get id from list when text input match or equal items exist on list ?
I work on angular 7
I have input text on nvabar.Component.html write on it part name as following :
<mat-form-field class="example-full-width"> <input matInput placeholder="Enter name" [(ngModel)]="partname" > </mat-form-field>
I need when write on text input Transistor part then I will search on list parts and get partid =2 .
navbar.component.ts
export class NavBarComponent implements OnInit { public parts = [ { id: 1, partname: 'hummer', }, { id: 2, partname: 'Transistor', }, { id: 3, partname: 'Air', } ]; ngOnInit() { }
So How to get partid from list when text box text matched items on list ?
--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/angular/15452628-b314-489f-a573-06b4263636b7%40googlegroups.com.