I am learning angular structural directives and I have encountered the following problem, I tried to use the switchcase but I am having a value that is not correct based on my condition.
I want to have an output of average if the grade is lower than 80 or higher than 75 but the output that I am getting is Invalid. However, once I removed the div tag of invalid then I do not have an output.
Here is my switch condition.
Template:
<div [ngSwitch]="grade">
<div *ngSwitchCase="grade >= 75 && grade <= 80">Average</div>
<div *ngSwitchDefault>Invalid</div>
</div>
Typescript:
public grade = 75;