Enums are great but they are not visible in Angular templates by default.
With this little trick you can make them accessible.

enum Animals {
  DOG,
  CAT,
  DOLPHIN
}

@Component({
  ...
})
export class AppComponent {
  animalsEnum: typeof Animals = Animals;
}

继续阅读 30秒学会 Angular 片段 – Accessing Enums in template