1

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 :

  • I want Search option in 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
}"

1 Answer 1

6
<mat-select-search [formControl]="formControlName"></mat-select-search>

Add this tag inside mat-select and follow the steps in app.component.ts of StackBlitz

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.