Coder Social home page Coder Social logo

rxjs-socket.io's Introduction

rxjs-socket.io

Here is how to run the code

Server: From the server folder

1-npm install

2-node server.js

Client: From the client folder

1-npm install

2-typings install

3-ng serve (assumes Angular CLI)

rxjs-socket.io's People

Contributors

thelgevold avatar yadimon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rxjs-socket.io's Issues

closure compiler ERROR Cannot read: dist temp.js

java -jar ./closure-compiler/compiler.jar --compilation_level SIMPLE_OPTIMIZAT
IONS --language_in=ES6 --language_out=ES5 --js ./dist/temp.js --js_output_file d
ist/bundle.js

ERROR - Cannot read: ./dist/temp.js

1 error(s), 0 warning(s)

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js" "run" "closure-compiler"
npm ERR! node v7.0.0
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] closure-compiler: java -jar ./closure-compiler/comp iler.jar --compilation_level SIMPLE_OPTIMIZATIONS --language_in=ES6 --language_o ut=ES5 --js ./dist/temp.js --js_output_file dist/bundle.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] closure-compiler script 'java -jar ./c
losure-compiler/compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS --language
_in=ES6 --language_out=ES5 --js ./dist/temp.js --js_output_file dist/bundle.js'.

npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular2-poc package,

npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! java -jar ./closure-compiler/compiler.jar --compilation_level SIMPL
E_OPTIMIZATIONS --language_in=ES6 --language_out=ES5 --js ./dist/temp.js --js_ou
tput_file dist/bundle.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-poc
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular2-poc
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Dev\WebEvalSamples\Angular\angular-2-samples\npm-debug.log

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js" "run" "install-application"
npm ERR! node v7.0.0
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install-application: npm run clean && npm run aot & & npm run rollup && npm run closure-compiler
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install-application script 'npm run cl
ean && npm run aot && npm run rollup && npm run closure-compiler'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular2-poc package,

npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run clean && npm run aot && npm run rollup && npm run closure-c
ompiler
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-poc
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular2-poc
npm ERR! There is likely additional logging output above.

Consider upgrading to latest tools

Please consider upgrading the code to use the latest tools. I'm trying to kick the tires on Socket.io and thought your sample might help. Sadly it did not run given the ReadMe instructions. I am getting exceptions from ng-serve suggesting issues with angular-cli and webpack.

What about a subject instead of creating Observable

Hello,
this is not an issue just a question.

In the chat.service.ts you have getMessage method and you are creating and returning a new Observable.

I am wondering. What if this method is implemented with Subject. Is that wrong?

example:

  getMessagesSubject() {
    this.socket = io(this.url);
    let subject = new Subject();
    this.socket.on('message', (data) => {
        subject.next(data);
    });
    return subject;
  }

ps: Awesome tutorial.

I get a connection but cant emit an alert

Hei Torgeir,
In my project i have more modules, and in one of them, the message module i have a service for messages.
I call the get messages method on my AppComponent. The problem is that when i console.log() the data that i get from getMessages() , it is empty , even that i send an object as data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.