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