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