Reputation: 1
I'm trying to hide an image using [hidden]
attribute using an array element, but its giving template parse error.
<img id="ProfilePictureResize_{{i}}" [hidden]="!{{temporarySubCategoryImageShow[i]}}" src="{{temporarySubCategoryImageUrl[i]}}"/>
But when I try [hidden]
with boolean
variable it works fine.
<img id="ProfilePictureResize_{{i}}" [hidden]="!isPreviewImage" src="{{temporarySubCategoryImageUrl[i]}}"/>
TS File:
public temporarySubCategoryImageShow: string[] = [];
private isPreviewImage: boolean = false;
Error Screenshot:
Upvotes: 0
Views: 191
Reputation: 15313
You have to remove the interpolation from the hidden
attribute.
[hidden]="!temporarySubCategoryImageUrl[i]"
Upvotes: 1
Reputation: 2408
Remove the interpolation "{{}}"
in [hidden]
attribute
[hidden]="!temporarySubCategoryImageShow[i]"
Upvotes: 2