New to Angular and Typescript, trying to set a control's attribute using a method on my Component. Is it possible to send the Button control itself as an argument?
<input type="button" id="Button1" data-something="{{ GetSomething(this) }}">
And my method on my Component:
GetSomething(sender) {
//do something with sender being the Button
console.log(sender.id);
return "garbage";
}
*ngClassor[class.foo]and the button element wouldn't really tell you anything.data-attribute instead. I used class just for this example. Will edit.