I current have a simple data binding:
{{ myAccount.Balance }}
I think applied a couple of filters:
{{ myAccount.Balance | filter1 | filter2 }}
However, i want to use a ternary operator when the Balance is less than zero, the below works (without the filters):
{{ myAccount.Balance > 0 ? myAccount.Balance : myAccount.Balance + 'minus' }}
How can i use my filters 1 and 2 in the above too?
You need to wrap them in parenthesis ()
to take precedency
{{ (myAccount.Balance > 0 ? myAccount.Balance : myAccount.Balance + 'minus') | filter | filter 2 }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With