I am trying to check a Boolean values truthiness in Angular HTML, and getting an odd result. After reading this SO post I thought I understood what was happening. I expected to be able to use the === operator, but as my last example below shows, that does not return the correct result.
The output states of my code above:
nothing selected, but default val is false
create new: false
double eq isCreateNew==false: true
string isCreateNew=='false': false <----- unexpected
obj isCreateNew===false: true
set to true create new: true
double eq isCreateNew==false: false
string isCreateNew=='false': false
obj isCreateNew===false: false
set to false
create new: false
double eq isCreateNew==false: false <----- unexpected
string isCreateNew=='false': true
obj isCreateNew===false: false <----- unexpected