how to check *ngIf with ENUMs in componenet.html code example

Example 1: how to check *ngIf with ENUMs in componenet.html

<span *ngIf="name === importedSomeEnum.someValue">This has some value</span>

Example 2: how to check *ngIf with ENUMs in componenet.html

import { Component } from '@angular/core';
import { SomeEnum } from './global';

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ]
})
export class AppComponent  {
  name = SomeEnum.someValue;
  importedSomeEnum = SomeEnum;
}

Tags:

Html Example