(eventHandlers)
| 12726 | return promise; |
| 12727 | |
| 12728 | function createApplyHandlers(eventHandlers) { |
| 12729 | if (eventHandlers) { |
| 12730 | var applyHandlers = {}; |
| 12731 | forEach(eventHandlers, function(eventHandler, key) { |
| 12732 | applyHandlers[key] = function(event) { |
| 12733 | if (useApplyAsync) { |
| 12734 | $rootScope.$applyAsync(callEventHandler); |
| 12735 | } else if ($rootScope.$$phase) { |
| 12736 | callEventHandler(); |
| 12737 | } else { |
| 12738 | $rootScope.$apply(callEventHandler); |
| 12739 | } |
| 12740 | |
| 12741 | function callEventHandler() { |
| 12742 | eventHandler(event); |
| 12743 | } |
| 12744 | }; |
| 12745 | }); |
| 12746 | return applyHandlers; |
| 12747 | } |
| 12748 | } |
| 12749 | |
| 12750 | |
| 12751 | /** |
no test coverage detected