I want to call some jQuery function targeting div with table. That table is populated with ng-repeat
.
When I call it on
$(document).ready()
I have no result.
Also
$scope.$on('$viewContentLoaded', myFunc);
doesn't help.
Is there any way to execute function right after ng-repeat population completes? I've read an advice about using custom directive
, but I have no clue how to use it with ng-repeat and my div...
I had to render formulas using MathJax after ng-repeat ends, none of the above answers solved my problem, so I made like below. It's not a nice solution, but worked for me...
This is an improvement of the ideas expressed in other answers in order to show how to gain access to the ngRepeat properties ($index, $first, $middle, $last, $even, $odd) when using declarative syntax and isolate scope (Google recommended best practice) with an element-directive. Note the primary difference:
scope.$parent.$last
.If you simply wants to change the class name so it will rendered differently, below code would do the trick.
This code worked for me when I had a similar requirement to render the shopped item in my shopping list in Strick trough font.