| 2243 | } |
| 2244 | |
| 2245 | function postDigestTaskFactory() { |
| 2246 | var postDigestCalled = false; |
| 2247 | return function(fn) { |
| 2248 | // we only issue a call to postDigest before |
| 2249 | // it has first passed. This prevents any callbacks |
| 2250 | // from not firing once the animation has completed |
| 2251 | // since it will be out of the digest cycle. |
| 2252 | if (postDigestCalled) { |
| 2253 | fn(); |
| 2254 | } else { |
| 2255 | $rootScope.$$postDigest(function() { |
| 2256 | postDigestCalled = true; |
| 2257 | fn(); |
| 2258 | }); |
| 2259 | } |
| 2260 | }; |
| 2261 | } |
| 2262 | |
| 2263 | // Wait until all directive and route-related templates are downloaded and |
| 2264 | // compiled. The $templateRequest.totalPendingRequests variable keeps track of |