| 2251 | var rawDocument = $document[0] || {hidden: true}; |
| 2252 | |
| 2253 | function postDigestTaskFactory() { |
| 2254 | var postDigestCalled = false; |
| 2255 | return function(fn) { |
| 2256 | // we only issue a call to postDigest before |
| 2257 | // it has first passed. This prevents any callbacks |
| 2258 | // from not firing once the animation has completed |
| 2259 | // since it will be out of the digest cycle. |
| 2260 | if (postDigestCalled) { |
| 2261 | fn(); |
| 2262 | } else { |
| 2263 | $rootScope.$$postDigest(function() { |
| 2264 | postDigestCalled = true; |
| 2265 | fn(); |
| 2266 | }); |
| 2267 | } |
| 2268 | }; |
| 2269 | } |
| 2270 | |
| 2271 | // Wait until all directive and route-related templates are downloaded and |
| 2272 | // compiled. The $templateRequest.totalPendingRequests variable keeps track of |