Not sure if I am doing this correctly but I am receiving an image with “ng-init”. Now I want to display the image only if there is an image to be displayed.
Custom Widget:
In the code above the “ng-if” are not working. Is there any way to check the value for “model_2017”? I am returning an empty String from the server with a Statuscode 202 (no content).
If this needs to be done in another way(controller, script file, items etc), then please point me in the right direction.
As I said, your ng-if will never be false because by the time ng-if is hit, you’ve already set model_2017 to something.
The widget-image does not take into account if the image exists or not. It will still show the widget, with a blank/missing (x) image if the image does not exist.
If you want to use a string item, your ng-init must be:
ng-init="model={url: itemValue('xxx'))"
and your ng-if will be