I’m comparing a number of fields in an Angular 2
template and it works for same case
properties but returns false
for the same string on different cases. Is there a way to make it case insensitive
perhaps through a simple pipe
?
<div *ngIf="query?.firstName == address.foreName"></div>
Advertisement
Answer
You should use ===
with toLowercase()
<div *ngIf="query?.firstName.toLowerCase() === address.foreName.toLowerCase()"></div>