I’m trying to set the ion-input type to “number” from an attribute directive.
The reason for this is on different platforms it plays differently. So I want to detect the platform, then set it to text/number accordingly.
In the directive if I do this
It sets on the ion-input, but not on the native input element, so has no effect.
If I do this:
@HostBinding('type') hostType: String = "number";
It seems to set on the ion-input as ng-reflect-type. But doesn’t affect the native input element.
So what would be the correct way to go about what I’m after?
I was trying to avoid getting a reference to the native input element and setting it directly on there.