I am using angular material (https://material.angular.io) in my application. I have tried with multiselect dropdown in material angular by using the chips (mat-chip-list). But I couldn't achieve it. Is there any one achieve it using angular material? If please share link or samples?
-
This might help you: cuppalabs.github.io/angular2-multiselect-dropdownabhijeetwebdev– abhijeetwebdev2017-11-03 06:36:29 +00:00Commented Nov 3, 2017 at 6:36
-
This lib has more stars: softsimon.github.io/angular-2-dropdown-multiselectabhijeetwebdev– abhijeetwebdev2017-11-03 06:39:21 +00:00Commented Nov 3, 2017 at 6:39
-
Thanks for the quick reply. But my requirement is to achieve the multi select dropdown using angular material2.vik– vik2017-11-03 06:43:28 +00:00Commented Nov 3, 2017 at 6:43
-
I haven't tried this yet but see if it works for you: npmjs.com/package/md2-multiselectabhijeetwebdev– abhijeetwebdev2017-11-03 06:45:35 +00:00Commented Nov 3, 2017 at 6:45
-
Material2 is extremely limited at the moment, you would be best looking for alternative while m2 is still in very early stagesCacoon– Cacoon2017-11-03 08:23:45 +00:00Commented Nov 3, 2017 at 8:23
Add a comment
|
1 Answer
This is already possible with Angular Material. Just add multiple or [multiple]="true" to your mat-select.
<mat-form-field>
<mat-select multiple>
<mat-option *ngFor="let option of options" [value]="option">
{{ option }}
</mat-option>
</mat-select>
</mat-form-field>
2 Comments
vik
Hi.This I have tried. But the selection of values in the checkbox. I don't required the checkbox. This must be normal select option. Once the user selects the option, It must be appear in text box with 'x'. If i click on 'x'. It should close. In this user can select multiple also.So Only i have tried with mat-chip-list. Is there any suggestion?
Will Howell
Maybe this will help: github.com/angular/material2/issues/3273#issuecomment-335089633