First Method -
You can pass varibale as method name using bracket notation like this-
<a (click)="this[action]()">
Login
</a>
Second Method -
(click) event always expects functionName() as it's value.
In your scenario you can add dynamic eventListner to listen to your function using @viewChild like this -
<a #myEvent (click)="action">
Login
</a>
@ViewChild('myEvent') myEvent: ElementRef;
ngAfterViewInit() {
(this.myEvent.nativeElement as HTMLElement).addEventListener('click', this.login.bind(this));
// Here you can bind to any method
}
login() {
console.log('login !');
}