I've searched for solutions, but nothing seems to work for me and now I'm feeling quite lost. My current setup involves Cordova, Ionic, and Angular 2.
Below is the HTML snippet:
<ion-col *ngFor="let value of myButtonsFirstRow" width-25>
<button #elem ptcolor (click)="volumeClick(elem)" attr.floatValue="{{value}}">
{{value | fraction}}
</button>
</ion-col>
And this is my TypeScript code:
volumeClick(htmlElem: HTMLElement) {
this.volumeSelected = +htmlElem.getAttribute('floatValue');
}
My aim is to retrieve the value from an attribute that I created in my HTML. However, it seems like I can't access the getAttribute method. Although the htmlElem variable is set, I am unable to see the method, and I know there's something wrong with what I'm doing, but I can't figure out what!
Any help would be greatly appreciated.