I have a method to that returns an integer value, {{Cart.totalItems()}}. This works fine. I wanted to know if it is possible to have this expression print a string based on the result of this method call. For example:
print "X" if the value returned is greater than 0, or "Y" otherwise.
Is this possible in the expression itself (for example by using a filter) or do I need to roll an Angular function to do this? I've used similar techniques done in the expression specified in an ng-showdirective, for example:
{true:'false',false:'true'}[ngTransaction.$state.shippingNameSameAsCustomerName]
However, I cannot seem to nail the syntax for this in view. Is it possible to render a string conditionally based on the output of a function call in an expression?