I have a small question about a compilation error that I'm getting.
At the moment I just cant find the solution for this, eventhough I'm pretty sure it is something very small.
My html for CategoryItemComponent:
<div>
<ion-row>
<ion-col size="6" *ngFor="let category of inventory">
<button class="category-box" (click)="GoToPage({{category.name}})">
<img class="category-icon" src="{{category.iconPath}}">
<p class="item-text">{{category.name}}</p>
</button>
</ion-col>
</ion-row>
</div>
My error message:
Error: Errors during JIT compilation of template for CategoryItemComponent: Parser Error: Unexpected token {, expected identifier, keyword, or string at column 11 in [GoToPage({{category.name}})] in ng:///CategoryItemComponent/template.html@5:46 ("<ion-col size="6" *ngFor="let category of inventory"> <button class="category-box" (click)="[ERROR ->]GoToPage({{category.name}})"> "): ng:///CategoryItemComponent/template.html@5:46, Parser Error: Missing expected ) at column 26 in [GoToPage({{category.name}})] in ng:///CategoryItemComponent/template.html@5:46 ("<ion-col size="6" *ngFor="let category of inventory">
Thanks in advance!
1条答案
按热度按时间gjmwrych1#
大括号不应该在那里。它应该只是
(click)="GoToPage(category.name)"
- @Andrei谢谢安德烈!