I am facing an issue with binding a function from an array of items to an element using ng-repeat in AngularJS. One of the attributes on each item is a custom function, like this:
item.myFunction = function(){
// do something
}
I tried various methods to bind this function to an onclick event or ng-click directive, such as:
<p onclick="{{item.myFunction}}">click me</p>
<p ng-click="{{item.myFunction}}">click me</p>
<p ng-attr-onclick="{{item.myFunction}}">click me</p>
I have searched online but couldn't find any solution. Is it even possible to achieve what I'm trying to do?