angular.module('app').factory('DevService', function ($rootScope, $window) { var service = {}; service.DoCallbackData = {}; service.WebForm_DoCallback = function (eventTarget, eventArgument, eventCallback, context, errorCallback, useAsync) { service.DoCallbackData = {eventTarget: eventTarget,eventArgument: eventArgument,eventCallback: eventCallback,context: context,errorCallback: errorCallback,useAsync: useAsync, }; $rootScope.$broadcast("WebForm_DoCallback"); } var oldWebForm_DoCallback = $window.WebForm_DoCallback; $window.WebForm_DoCallback = function (eventTarget, eventArgument, eventCallback, context, errorCallback, useAsync) { service.WebForm_DoCallback(eventTarget, eventArgument, eventCallback, context, errorCallback, useAsync) if (oldWebForm_DoCallback != null) {oldWebForm_DoCallback(eventTarget, eventArgument, eventCallback, context, errorCallback, useAsync); } }; return service;});