Answers for "how to check *ngIf with ENUMs in componenet.html"

0

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;
}
Posted by: Guest on October-15-2020
0

how to check *ngIf with ENUMs in componenet.html

<span *ngIf="name === importedSomeEnum.someValue">This has some value</span>
Posted by: Guest on October-15-2020

Browse Popular Code Answers by Language