Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

select: multiple attribute only checks for existence but docs indicate that it evaluates true/false #3068

Closed
@myagoo

Description

@myagoo

If I want to tell wether a md-select should be multiple from a scope key, I must do this :

<md-select ng-if="multiple" multiple .../>
<md-select ng-if="!multiple" .../>

Because all those lines have the same behavior, they set initialize the select as multiple :

<md-select multiple="true" .../>
<md-select multiple="false" .../>
<md-select multiple="{{true}}" .../>
<md-select multiple="{{false}}" .../>

In the source code of md-select directive, I can see this LoC :
https://github.com/angular/material/blob/master/src/components/select/select.js#L387
I can understand why all 4 lines have the same behavior.

So I tried to use ng-multiple and the select started to work correctly... in appearance only : the model is now all messed up.

Here is a codepen where you can see select behavior and the associated model : http://codepen.io/myagoo/pen/OVWGqz

Metadata

Metadata

Assignees

Labels

P4: minorMinor issues. May not be fixed without community contributions.has: Pull RequestA PR has been created to address this issueresolution: fixedtype: docs

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions