(eventHandlers)
| 12033 | return promise; |
| 12034 | |
| 12035 | function createApplyHandlers(eventHandlers) { |
| 12036 | if (eventHandlers) { |
| 12037 | var applyHandlers = {}; |
| 12038 | forEach(eventHandlers, function(eventHandler, key) { |
| 12039 | applyHandlers[key] = function(event) { |
| 12040 | if (useApplyAsync) { |
| 12041 | $rootScope.$applyAsync(callEventHandler); |
| 12042 | } else if ($rootScope.$$phase) { |
| 12043 | callEventHandler(); |
| 12044 | } else { |
| 12045 | $rootScope.$apply(callEventHandler); |
| 12046 | } |
| 12047 | |
| 12048 | function callEventHandler() { |
| 12049 | eventHandler(event); |
| 12050 | } |
| 12051 | }; |
| 12052 | }); |
| 12053 | return applyHandlers; |
| 12054 | } |
| 12055 | } |
| 12056 | |
| 12057 | |
| 12058 | /** |
no test coverage detected