I have nested ng-repeat
constructions inside my directive like this:
<calendar>
<div class="calendar-row" ng-repeat="calendarRow in calendarRows">
<calendar-day ng-repeat="calendarDay in calendarRow.days" />
</div>
</calendar>
I need to execute a function after everything will be rendered.
I will achieve this if I wrap my function is inside in 4 nested $timeout
calls:
$timeout(function() {
$timeout(function() {
$timeout(function() {
$timeout(function() {
myFunc();
});
});
});
});
It looks for me like a hack. Is it possible to reduce $timeout
calls? I don't understand why 4 calls are needed in my case.
Or is it more elegant way to implement it?