0

My service returns some data and i use it into my View. I'm trying to pass a specific ID into my onDivClick method on a click event.

I want to do something like that but 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 ?

1
  • 1
    and what does the onDivClick method look like? Commented Jul 19, 2016 at 11:49

1 Answer 1

4

Just remove {{}}

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

If you have () or [] you must not use {{}} as well

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.