I need to dynamically add a click event to an div tag:
<div *ngIf="item.click">
    <div (click)="item.click" >{{item.name}} (should trigger( {{item.click}})</div>
</div>
My object looks like this:
item: {name: 'Action', click: '_actionService.triggerAction()'}
I don't get any error when running the code but the click event doesn't seem to have been created.
Any suggestions?

(click)="item.click ? doSomething($event) : null"to only calldoSomething()in case of a user click whenitem.clickis truthy.(click)="item.click"is supposed to do (it won't do anything how it is currently)itemelements instead of strings ?