In an attempt to conditionally assign a class based on the value of a boolean variable, I have declared the variable in the parent component:
public alteredSidebar: boolean;
This is my approach for dynamically setting the classname:
<div [class]="alteredSidebar == false ? 'secondsidenav' : 'sidenav'" id="rollup-sidenav" [ngClass]="{ 'greyout': greyOut }"></div>
I have defined two classes in a CSS file - one named secondsidenav and the other sidenav. I intend for the classname to be set to secondsidenav when the boolean is false, and sidenav otherwise. Here is an example usage where I expect the class to be 'secondsidenav':
<app-rollup [data]="rollupData" (resetCalled)="onRollupReset()" (entrySelected)="onRollupSelectEvent($event)" [alteredSidebar]="false">
</app-rollup>
However, I am encountering the error: "Can't bind to 'alteredSidebar' since it isn't a known property of 'app-rollup'."