I have an issue with using Cloudinary with Angular. If I add a simple image like this:
<cl-image class="img-fluid" [public-id]="brand.image.publicId" dpr="auto" crop="scale">
<cl-placeholder type="pixelate">
</cl-placeholder>
<cl-transformation quality="auto" fetch-format="auto" width="500">
</cl-transformation>
</cl-image>
This works fine. If I try then to add a width:
<cl-image class="img-fluid" [public-id]="brand.image.publicId" dpr="auto" crop="scale">
<cl-placeholder type="pixelate">
</cl-placeholder>
<cl-transformation width="150" crop="thumb">
</cl-transformation>
<cl-transformation quality="auto" fetch-format="auto" width="500">
</cl-transformation>
</cl-image>
This also works. But I want my width to be a variable, not a static width. So I updated the code to this:
<cl-image class="img-fluid" [public-id]="brand.image.publicId" dpr="auto" crop="scale" *ngIf="width">
<cl-placeholder type="pixelate">
</cl-placeholder>
<cl-transformation [width]="width" crop="thumb">
</cl-transformation>
<cl-transformation quality="auto" fetch-format="auto" width="500">
</cl-transformation>
</cl-image>
And this doesn't work. It displays the image, but it has not resized it, which is no good. Notice this line:
<cl-transformation [width]="width" crop="thumb">
It's like it is being ignored, also I made sure the component is not being created until a width was set by using *ngIf="width".
Does anyone know why this isn't working?