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