Hi
genderList = ['Male', 'Female']. I want to display usimg matselect in Angular 17.
Thanks
Hi
genderList = ['Male', 'Female']. I want to display usimg matselect in Angular 17.
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Vishal YelveRank #178 · 13.6K reputationPosted Jul 29, 2024, 2:06 AM EDT
Hi Ramco,
do refer to below link
https://material.angular.io/components/select/overview#select-multiple
Ts file
import {Component} from '@angular/core'; import {FormControl, FormsModule, ReactiveFormsModule} from '@angular/forms'; import {MatSelectModule} from '@angular/material/select'; import {MatFormFieldModule} from '@angular/material/form-field'; /** @title Select with multiple selection */ @Component({ selector: 'select-multiple-example', templateUrl: 'select-multiple-example.html', standalone: true, imports: [MatFormFieldModule, MatSelectModule, FormsModule, ReactiveFormsModule], }) export class SelectMultipleExample { genders = new FormControl(''); genderList: string[] = ['Male', 'Female', 'Undisclosed']; }html