I am just asking this as I cant find it anywhere.
I have an angular object column.addOnParams
This object containes a child element of rowClick, so it would be column.addOnParams.rowClick
In this child element contains the word myclickevent();
Is it possible to pass this to a ng-click.
So it would be as follows.
<td ng-repeat="column in columns" class="" ng-click="column.addOnParams.rowClick"></td>
I have tried it in the way above, but nothing gets generated, it just shows it as it is, after page load.
I also tried the following,
<td ng-repeat="column in columns" class="" ng-click="{{column.addOnParams.rowClick}}"></td>
That throws a reference error in angular,
Syntax Error: Token 'column.addOnParams.rowClick' is unexpected, expecting [:] at column 3 of the expression [{{column.addOnParams.rowClick}}] starting at [column.addOnParams.rowClick}}].
Any advice from you guys?
Side note when using this for the class object it works.
<td ng-repeat="column in columns" class="{{column.addOnParams.cssClass}}"></td>
The above statement generates and works perfectly.
Thanks to @J-D comment, the plunker solution worked like a charm Working solution
Using the this keyword was what I needed.
rowClickshould be a string without(), likemyclickeventng-click="column.addOnParams.rowClick()"... gets bound directly to controller method