I want to call some jQuery function targeting div with table. That table is populated with ng-repeat
.
When I call it on
$(document).r
There is no need of creating a directive especially just to have a ng-repeat
complete event.
ng-init
does the magic for you.
the $last
makes sure, that finished
only gets fired, when the last element has been rendered to the DOM.
Do not forget to create $scope.finished
event.
Happy Coding!!
EDIT: 23 Oct 2016
In case you also want to call the finished
function when there is no item in the array then you may use the following workaround
//or
Just add the above line on the top of the ng-repeat
element. It will check if the array is not having any value and call the function accordingly.
E.g.