` and " /> ` and " /> ` and "/>

Show checkbox if condition is met in Angular app

22 Views Asked by At

Hello I have an expansion panel like below in an Angular app.

<mat-expansion-panel *ngFor="let column of advancedFilterColumns; let i = index"> ` and in that panel I have a

<div><mat-checkbox aria-label="Select All">Select All </mat-checkbox></div>

I need to hide the div containing the checkbox if column.name = 'games'

pseudo code ' <div *ngIf="column.name === 'game' then visible = true'

How can I make this happen?

1

There are 1 best solutions below

0
Rick On

your posting is very confusing:

  1. in one part you have 'games' and in another part is says 'game'. which is it?

  2. I don't think you want to use triple-equals (===) for angular.

  3. I'm a little confused as to what you are trying to do.

But in order to "hide" something, its just use *ngIf with a "not" sign (!)

<div *ngIf="column.name != 'game'>
   <checkbox>
</div>