(eventHandlers)
| 13297 | return promise; |
| 13298 | |
| 13299 | function createApplyHandlers(eventHandlers) { |
| 13300 | if (eventHandlers) { |
| 13301 | var applyHandlers = {}; |
| 13302 | forEach(eventHandlers, function(eventHandler, key) { |
| 13303 | applyHandlers[key] = function(event) { |
| 13304 | if (useApplyAsync) { |
| 13305 | $rootScope.$applyAsync(callEventHandler); |
| 13306 | } else if ($rootScope.$$phase) { |
| 13307 | callEventHandler(); |
| 13308 | } else { |
| 13309 | $rootScope.$apply(callEventHandler); |
| 13310 | } |
| 13311 | |
| 13312 | function callEventHandler() { |
| 13313 | eventHandler(event); |
| 13314 | } |
| 13315 | }; |
| 13316 | }); |
| 13317 | return applyHandlers; |
| 13318 | } |
| 13319 | } |
| 13320 | |
| 13321 | |
| 13322 | /** |
no test coverage detected