Closed GabriMagic closed 6 years ago
Hello, I'm trying to use this with my Angular 6, I have the app.module config:
SocketIoModule.forRoot(config)
And simple chat service:
import { Injectable } from '@angular/core'; import { Socket } from 'ng6-socket-io'; import { map } from 'rxjs/operators'; @Injectable({ providedIn: 'root' }) export class ChatService { constructor(private socket: Socket) { console.log('Init ChatService'); } sendMessage(msg: string) { this.socket.emit('message', msg); } getMessage() { return this.socket.fromEvent('message').pipe(map(data => data)); } }
And when I go to the web, I get this in the console:
i have the same problem..
any solution to this?
No, but use this library that solve the problem : ngx-socket-io npm i ngx-socket-io
npm i ngx-socket-io
Hello, I'm trying to use this with my Angular 6, I have the app.module config:
And simple chat service:
And when I go to the web, I get this in the console: