简体   繁体   English

使用Angular 4,Ionic和Cloudinary用字符串插值错误绑定变量值

[英]Binding Variable Value with String Interpolation Error with Angular 4, Ionic and Cloudinary

I am using ionic 3, angular 4, Cloudinary to build an image editing application. 我正在使用Ionic 3,Angular 4,Cloudinary来构建图像编辑应用程序。 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'." 我试图显示图像并应用叠加转换,但是当尝试将变量值绑定到叠加public_ID时,出现错误:“无法绑定到“叠加”,因为它不是“ cl”的已知属性-转型'。” To isolate the issue I assigned the variable a fixed value of a correct public ID, yet it still does not work. 为了找出问题,我为变量分配了正确的公共ID的固定值,但仍然无法使用。 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> 

您可以使用属性值:

[attr.overlay]="overlayID"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM