Skip to content

klerick/fs-socket-io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

An Angularjs module with full a simple functional of socket.Io.

with Sharing connection between Browser's windows and tabs across local storage

Install

  1. download the files

    1. Bower
      1. add "fs-socket-io": "latest" to your bower.json file then run bower install OR run bower install fs-socket-io
    2. include the files in your app
      1. fs-socket-io.js
  2. include the module in angular (i.e. in app.js) - fs-socket-io

    angular.module("testApp", ['fs-socket-io']);
  3. config path and prefix

    	angular.config("testApp", ['fsSocketIoProvider', function(fsSocketIoProvider){
    	    fsSocketIoProvider.prefixShare('somePrefix');
    	    fsSocketIoProvider.socketUrl('some/path/socket/connect');
    	}]);
  4. init connect

        angular.run("testApp", ['fsSocketIo', function(fsSocketIo){
        }]);
  5. In your controller

        $scope.$on('socket:YourSocketEvent')
       fsSocketIo.emit('YourSocketEmitEvent', param)

About

AngularJs and Socket.IO with shared socket connection throw tabs

Resources

Stars

Watchers

Forks

Packages

No packages published