I have a component that has a click handler which takes in an enum type as a parameter and would like to use that enum type in the component html template when the handler is called, however I get a type error:
Argument of type '"ERROR"' is not assignable to parameter of type 'DownloadType'
enum
export enum DownloadType {
CURRENT = "CURRENT",
ALL = "ALL",
ERROR = "ERROR",
}
action-bar.component.ts
onDownload(downloadType: DownloadType) {
// do stuff
}
action-bar.component.html
<button (click)="onDownload('ERROR')">Download Errors</button>
I have tried supplying the enum value without quotes to the handler as well, but that also did not work ("onDownload(DownloadType.ERROR)"
)