2

I am using ionic 3, angular 4, Cloudinary to build an image editing application. I am trying to display an image and apply an overlay transformation, however when trying to bind a variable value to the overlays public_ID I get an error: "Can't bind to 'overlay' since it isn't a known property of 'cl-transformation'." To isolate the issue I assigned the variable a fixed value of a correct public ID, yet it still does not work. Please take a look at the code below which shows a working example and the non working example.

//Works perfectly fine

<cl-image public-id="sample.jpg" >
  <cl-transformation overlay="testOverlay" height= "400">
  </cl-transformation>
</cl-image>

export class ImagesPage {

overlayID: string = "testOverlay";
//Throws error

<cl-image public-id="sample.jpg" >
  <cl-transformation overlay="{{overlayID}}" height= "400">
  </cl-transformation>
</cl-image>

2
  • Did you try this style of syntax: [overlay]="overlayID" Commented Nov 22, 2017 at 22:59
  • Yea did try that one, but still get the same error. Commented Nov 22, 2017 at 23:03

1 Answer 1

1

you can use attribute value :

[attr.overlay]="overlayID"
Sign up to request clarification or add additional context in comments.

3 Comments

You sir, are a lifesaver. Thank you
you're welcome, you can check it as correct if it helped
[attr.overlay]="overlayID"would be the proper way to do it, since string interpolation is not recommended for attribute binding :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.