After following the instructions on ng-socket github page to import the socket io module, I encountered an error:
Unexpected value '[object Object]' imported by the module
'AppModule'. Please add a @NgModule annotation
This is the code I have used:
import { SocketIoModule, SocketIoConfig } from 'ng-socket-io';
const config: SocketIoConfig = { url: 'http://localhost:8988', options: {} };
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
SocketIoModule.forRoot(config)
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
If anyone has successfully implemented socket io with Angular2, please advise on what else needs to be added or recommend better packages.