An AngularJS 1.x service for real-time WebSocket communication, version 2.0.1. Designed for Angular 1.x applications, it provides a $websocket factory that wraps the native WebSocket API with Angular's digest cycle. Features include auto-reconnection, message queuing before connection, and promise-based lifecycle events. Last stable release via npm/Bower, but development appears stalled (no updates since 2016). Alternatives for Angular 2+ include rxjs/webSocket or Socket.IO.
npm install angular-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a WebSocket connection, receiving messages, sending messages, and integrating with Angular scope.
Wrap message handling in $scope.$apply() or use $timeout.
Consider migrating to Angular 2+ and using native WebSocket or rxjs/webSocket.
Always use 'ngWebSocket' as the module name for consistency.
Use $websocket(url) to create a connection, and methods like .send(), .onMessage() on the returned instance.
Use `var ws = $websocket('ws://...');` after injecting '$websocket' into your service/controller.Add `'ngWebSocket'` to your module dependencies: `angular.module('myApp', ['ngWebSocket'])`Use `$timeout(function() { ... });` instead of $scope.$apply() to safely run in next digest.