Open alikenski opened 5 years ago
I have a one error: scope.$on is not a function at http://URL/js/socket/directive.socket.js:92:21
forward: function (events, scope) { if (events instanceof Array === false) { events = [events]; } if (!scope) { scope = defaultScope; } events.forEach(function (eventName) { var prefixedEvent = prefix + eventName; var forwardBroadcast = asyncAngularify(socket, function () { Array.prototype.unshift.call(arguments, prefixedEvent); scope.$broadcast.apply(scope, arguments); }); **scope.$on**('$destroy', function () { socket.removeListener(eventName, forwardBroadcast); }); socket.on(eventName, forwardBroadcast); }); }
I have a one error: scope.$on is not a function at http://URL/js/socket/directive.socket.js:92:21
forward: function (events, scope) { if (events instanceof Array === false) { events = [events]; } if (!scope) { scope = defaultScope; } events.forEach(function (eventName) { var prefixedEvent = prefix + eventName; var forwardBroadcast = asyncAngularify(socket, function () { Array.prototype.unshift.call(arguments, prefixedEvent); scope.$broadcast.apply(scope, arguments); }); **scope.$on**('$destroy', function () { socket.removeListener(eventName, forwardBroadcast); }); socket.on(eventName, forwardBroadcast); }); }