MCPcopy
hub / github.com/angular-ui/ui-router / createApplyHandlers

Function createApplyHandlers

test/angular/1.5/angular.js:12035–12055  ·  view source on GitHub ↗
(eventHandlers)

Source from the content-addressed store, hash-verified

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 /**

Callers 1

sendReqFunction · 0.70

Calls 2

forEachFunction · 0.70
callEventHandlerFunction · 0.70

Tested by

no test coverage detected