Home > front end >  Errors during JIT compilation
Errors during JIT compilation

Time:09-09

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  (click)="GoToPage({{category.name}})">
          <img  src="{{category.iconPath}}">
          <p >{{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 (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!

CodePudding user response:

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

Thanks Andrei!

  • Related