Reputation: 4502
I have a div element in my HTML like so
<div (click) = onPaginationClick() *ngFor="let section of sections">next</div>
My question is : How to pass a variable to the onPaginationlick() function ? when I try to pass it like this :
<div (click)=onPaginationClick({{section.id}}) *ngFor="let section of sections">next</div>
I'm getting a parse template error.
Upvotes: 1
Views: 56
Reputation: 214175
Don't use (...)
and {{...}}
together:
(click)="onPaginationClick(section.id)"
Upvotes: 3