DEV Community

Kushal J
Kushal J

Posted on

Answer: Duplicate Identifier Issue with ngClass

It seems this line was the culprit in AOT.

[ngClass]="{'active': math.Name == subjectVM.SelectedMathDomain,'active': math.Title == subjectVM.SelectedDomain}"

And I changed it to

[ngClass]="{'active': (math.Name == subjectVM.SelectedMathDomain || math.Title == subjectVM.SelectedDomain)}"

I wonder why the first line does not throw an error in JIT.

Top comments (0)