javascript - How to dynamically pass params into a click event method in angular 2 -


my service returns data , use view. i'm trying pass specific id ondivclick method on click event.

i want it's not working :

<div *ngfor="let d of data" class="widget-body no-padding">   <a class="list-group-item" href="#" (click)="ondivclick({{d.data_id}})">        ...   </a> </div> 

any ideas ?

just remove {{}}

 <a class="list-group-item" href="#" (click)="ondivclick(d.data_id)"> 

if have () or [] must not use {{}} well


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -