[FIXED] Errors during JIT compilation

Issue

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!

Solution

curly braces shouldnt be there. it should be just (click)="GoToPage(category.name)" – @Andrei

Thanks Andrei!

Answered By – HereToLearn

Answer Checked By – Dawn Plyler (Easybugfix Volunteer)

Leave a Reply

(*) Required, Your email will not be published