Search code examples
javascriptangularjsangular-filters

Angular JS apply uppercase filter to boolean value?


I have an angular 1.4.12 binding:

{{ mob.mobDataSettings[7].value | uppercase }}

where the first part is a boolean from a json file which is of course either true or false.

however, in the rendered HTML it is not being uppercased (i.e. TRUE), it's printing as true.

Am I missing something obvious?


Solution

  • If it's a boolean, even if it could work, it's bad practise to try to apply a filter made for strings.
    I suggest you go with {{ mob.mobDataSettings[7].value ? "TRUE" : "FALSE" }}