angular-signalr-hub icon indicating copy to clipboard operation
angular-signalr-hub copied to clipboard

Websockets interceptor ?

Open trinvh opened this issue 7 years ago • 0 comments

Hi, I'm finding a way to support global interceptor for websockets like http interceptor.

Like this:

if (options && options.methods) {
	angular.forEach(options.methods, function (method) {
		Hub[method] = function () {
			var args = $.makeArray(arguments);
			args.unshift(method);
                        alert('display loading...');
			return Hub.invoke.apply(Hub, args);
                        // How to handle promise after method done or fail ?
		};
	});
}

Anyway to solve this without handle in controller ?

trinvh avatar Feb 14 '17 17:02 trinvh