Assumign I have the following template expression:
<md-input type="number" #power [placeholder]="powerLabel" required>
</md-input>
I want to access power.value from my component .ts file, how I can do that?
Using ([ngModel]) gave me some console errors I couldn't manage to handle.
Not sure if it will work but have you tried creating a member variable using ViewChild like this: @ViewChild('power') power;
Then you can handle the value using this.power.nativeElement.value
Remember to import ViewChild: import {ViewChild} from '@angular/core';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With