I am trying to use a switch to control some image url parameters. My image.marketplace
node is a image.url.indexOf('?')
and evaluates to either -1
or a positive integer if a question mark is present in the url. I can get my expression (ng-switch on="{image.marketplace == -1}"
) to evaluate properly, but it does not trigger the correct "when" condition. Any thoughts about why?
<span ng-switch on="{image.marketplace == -1}">
<img ng-switch-when="true" ng-src="{{image.value}}?wid=100&hei=100">
<img ng-switch-when="false" ng-src="{{image.value}}&wid=100&hei=100">
<img ng-switch-default ng-src="{{image.value}}">
</span>