Reputation: 85
I have mat-select
Drop-down from angular material.
It has list of state which is coming from API. It has more than 10 options in Drop-down.
Todo :
mat-select
.I used mat-select search
from stackblitz but it's really difficult to understand. Please suggest me simple way to do it.
My json code
"{
"data": [
{
"id": 32,
"name": "Andaman And Nicobar Islands"
},
{
"id": 16,
"name": "Odisha"
},
{
"id": 34,
"name": "Puducherry"
},
{
"id": 19,
"name": "Uttar Pradesh"
},
{
"id": 5,
"name": "Uttarakhand"
},
{
"id": 6,
"name": "Andhra Pradesh"
}
],
"statusCode": 200
}"
Upvotes: 1
Views: 352
Reputation: 1793
<mat-select-search [formControl]="formControlName"></mat-select-search>
Add this tag inside mat-select and follow the steps in app.component.ts of StackBlitz
Upvotes: 6