Skip to content

scope.$on is not a function #164

@alikenski

Description

@alikenski

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); }); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions