I made an enum with Typescript to use in MyService.service.ts MyComponent.component.ts and MyComponent.component.html.
export enum ConnectionResult { Succes
You will have to write it in the following way in .ts file.
.ts
enum Tenure { day, week, all } export class AppComponent { tenure = Tenure.day TenureType = Tenure }
And now in html you can use this like
*ngIf = "tenure == TenureType.day ? selectedStyle : unSelectedStyle"
I hope it is more clear now. :)