Steve Steve - 1 year ago 150
AngularJS Question

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.
), it's printing as

Am I missing something obvious?

Answer Source

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" }}

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download