Assign click event to <a> element in <li> list for angular 15

0 Answers 425 Views
Forms
Saby
Top achievements
Rank 1
Veteran
Iron
Saby asked on 15 Mar 2023, 04:14 PM

Hello,
I am generating a template that contains a dynamic button panel, and I need to assign a click event to an <a> element within a dynamically generated <li> list. I get the values ​​from a Json object.
The function value of each element of the list comes from a Json object value (fieldChildren.action), but when trying to assign the event (click)="fieldchildren.action", it is not being created correctly.
Please help me with some indication in this regard.
I am using kendo multistep form with angular 15

 

<ul ngbDropdownMenu id="addoptions" aria-labelledby="Button_Add" class="dropdown-menu">
      <li *ngFor = "let campoChildren of campodisplay.children">
                    <a class="dropdown-item" (click)="campoChildren.action">{{campoChildren.name}}</a>
       </li>
</ul>

No answers yet. Maybe you can help?

Tags
Forms
Asked by
Saby
Top achievements
Rank 1
Veteran
Iron
Share this question
or