Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

md-select change event not firing #2359

Closed
Dgiulian opened this issue Dec 22, 2016 · 4 comments
Closed

md-select change event not firing #2359

Dgiulian opened this issue Dec 22, 2016 · 4 comments

Comments

@Dgiulian
Copy link

Bug, feature request, or proposal:

Bug

What is the expected behavior?

After the user selects a value from the select box, the change event must be fired.

What is the current behavior?

None. The change function asociated with the event is never executed.

What are the steps to reproduce?

Plunker: http://plnkr.co/edit/sSprD4?p=preview

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, browsers are affected?

"@angular/common": "2.3.1",
"@angular/material": "^2.0.0-alpha.11-3",

Is there anything else we should know?

@Dgiulian Dgiulian changed the title md-select not md-select change event not firing Dec 22, 2016
@jmpmscorp
Copy link

jmpmscorp commented Dec 23, 2016

You could use (ngModelChange) instead of (change). This works for me:
<md-select *ngIf="cultivos" placeholder="Cultivo" formControlName="idCultivo" (ngModelChange)="cultivoChange()" class="input-form">
<md-option *ngFor="let cultivo of cultivos" [value]="cultivo.idCultivo">{{cultivo.usoSigpac}} - {{cultivo.fruto}} - {{cultivo.variedad}}</md-option>
</md-select>

@kara
Copy link
Contributor

kara commented Dec 28, 2016

Dupe of #2248.

@kara kara closed this as completed Dec 28, 2016
@Eduard011
Copy link

@Dgiulian
Para que el evento (change)="onChange($event)" funcione debes de importar MdSelectChange

import { MdSelectChange } from '@angular/material';

//Evento (change)
onChangeSelect(event: MdSelectChange) {
console.log(event.value)
}

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants