Skip to content

Commit 662bdd0

Browse files
committed
Enable ngx-socket-io module
1 parent 05a9148 commit 662bdd0

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/app/app.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';
2-
//import { Socket } from 'ngx-socket-io';
2+
import { Socket } from 'ngx-socket-io';
33

44

55
@Component({
@@ -9,14 +9,14 @@ import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';
99
})
1010
export class AppComponent implements OnInit {
1111

12-
//public bridgeStatus$;
12+
public socketData$;
1313

1414
constructor(
15-
//private socket: Socket
15+
private socket: Socket
1616
) {}
1717

1818
ngOnInit() {
19-
// this.bridgeStatus$ = this.socket.fromEvent<any>('bridgeStatus');
19+
this.socketData$ = this.socket.fromEvent<any>('bridgeStatus');
2020
}
2121
}
2222

src/app/app.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ <h1>Testing IVY</h1>
66

77
<p>Socket data:
88

9-
<!---
10-
{{ bridgeStatus$ | async | json }}
11-
-->
9+
10+
{{ socketData$ | async | json }}
11+
1212
</p>
1313

1414

src/app/app.module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ import { BrowserModule } from '@angular/platform-browser';
55
import { NgModule } from '@angular/core';
66

77
// Socket.IO
8-
//import { SocketIoModule, SocketIoConfig } from 'ngx-socket-io';
8+
import { SocketIoModule } from 'ngx-socket-io';
99

1010
import { AppComponent } from './app.component';
1111

1212

1313
@NgModule({
1414
imports: [
1515
BrowserModule,
16-
/*
16+
1717
SocketIoModule.forRoot({
1818
'url': environment.server,
1919
options: {
2020
}
2121
})
22-
*/
22+
2323
],
2424
declarations: [
2525
AppComponent

0 commit comments

Comments
 (0)