Topic: How to code select two way binding using angular 2 components
I am trying like this.
In component.html
----------------------
<mdb-select [options]="surahSelect" placeholder="సూరహ్" (change)="onChange($event.target.value)"></mdb-select>
In component.ts
-------------------
ngOnInit() {
}
onChange(newValue) {
console.log(newValue); // ****Not get console output
}
With default select I am able to get. But with <mdb-select> I am not. Please share the sample example.
Sebastian Kaczmarek staff pro premium answered 7 years ago
selected
event instead of change
. See example:
<mdb-select [options]="surahSelect" placeholder="సూరహ్" (selected)="onChange($event)"></mdb-select>
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No