Skip to content
Advertisement

Angular 2/4 String Comparison with Ignore Case

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?

JavaScript

Advertisement

Answer

You should use === with toLowercase()

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement