Bug
After the user selects a value from the select box, the change event must be fired.
None. The change function asociated with the event is never executed.
Plunker: http://plnkr.co/edit/sSprD4?p=preview
"@angular/common": "2.3.1",
"@angular/material": "^2.0.0-alpha.11-3",
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>
@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)
}
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._
Most helpful comment
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>