I am working on enhancing the functionality of the function provided below by adding types to it,
clickEvent(event:Event) {
this.event = event
}
The HTML Code:
<a [href]="href" [target]="target" (click)="clickEvent('text')"></a>
Defining Types:
export interface EventTypes {
click?: string;
load?: string;
link?: string;
}
However, when I try to assign these types to clickEvent
, I encounter an error related to the event
parameter as shown below,
[ts] Argument of type 'EventTypes' is not assignable to parameter of type 'string'. [2345]
I would appreciate it if someone could shed some light on what mistake I might be making in this context.