In my Ionic app, I have the following code snippet that I am currently viewing with ionic serve. However, when the initial ng-switch statement triggers...
<span ng-switch="post.enclosure">
<span ng-switch-when="[]">
<p>def</p>
<img ng-src="{{defaultImage}}" style="max-width: 80%!important;">
</span>
<span ng-switch-default>
<img ng-src="{{post.enclosure.link}}" style="max-width: 90%!important;">
</span>
</span>
Upon executing this code, I encounter a generated output - but why?
<span ng-switch="post.enclosure">
<!-- ngSwitchWhen: [] -->
<!-- ngSwitchDefault: -->
<span ng-switch-default="">
<img style = "max-width: 90%!important;">
</span>
<!—end ngSwitchWhen: -->
</span>
Why is the image source not being displayed as expected?
Is there an alternative method that can be used instead of using ng-switch?