I have the following controller:
app.controller('TestController', function($scope) {
$scope.tests = [{
name: 'Name 1',
description: 'Some Description',
actionHandler: function() {
alert('Action Handler called');
}
},
...
];
});
In my htmlfile I do an ng-repeat like this:
<div ng-repeat="test in tests">
<p>{{test.name}}</p>
<p>{{test.description}}</p>
<a ng-click="{{test.actionHandler}}">Click me</a>
</div>
It is not really working. I also tried.
<a ng-click="test.actionHandler">Click me</a>
And
<a ng-click="test.actionHandler()">Click me</a>
But none seem to work. Any idea how I can call a function of an object inside ng-repeat?
Thanks, xCoder.