@@ -121,7 +121,11 @@ import { RxStomp } from '@stomp/rx-stomp';
121
121
@Injectable ({
122
122
providedIn: ' root' ,
123
123
})
124
- export class RxStompService extends RxStomp {}
124
+ export class RxStompService extends RxStomp {
125
+ constructor () {
126
+ super ();
127
+ }
128
+ }
125
129
```
126
130
127
131
#### Factory to create and initialize RxStompService
@@ -151,7 +155,7 @@ providers: [
151
155
provide: RxStompService ,
152
156
useFactory: rxStompServiceFactory ,
153
157
},
154
- ]
158
+ ];
155
159
```
156
160
157
161
Also, add appropriate import lines towards the top of this file (after the existing import
@@ -406,10 +410,10 @@ export class MessagesComponent implements OnInit, OnDestroy {
406
410
407
411
ngOnInit() {
408
412
this .topicSubscription = this .rxStompService
409
- .watch (' /topic/demo' )
410
- .subscribe ((message : Message ) => {
411
- this .receivedMessages .push (message .body );
412
- });
413
+ .watch (' /topic/demo' )
414
+ .subscribe ((message : Message ) => {
415
+ this .receivedMessages .push (message .body );
416
+ });
413
417
}
414
418
415
419
ngOnDestroy() {
@@ -432,11 +436,11 @@ export class MessagesComponent implements OnInit, OnDestroy {
432
436
- Using [ token authentication] ( /faqs/faqs.html#p-can-i-use-token-based-authentication-with-these-libraries-p )
433
437
with the STOMP broker.
434
438
435
-
436
439
[ tour-of-heroes ] : https://angular.io/tutorial
437
440
[ angular-di ] : https://angular.io/guide/dependency-injection
438
441
[ rx-stomp ] : /api-docs/latest/classes/RxStomp.html
439
442
[ rx-stomp-publish ] : /api-docs/latest/classes/RxStomp.html#publish
440
443
[ rx-stomp-watch ] : /api-docs/latest/classes/RxStomp.html#watch
441
444
[ https://github.com/stomp-js/rx-stomp-angular ] : https://github.com/stomp-js/rx-stomp-angular
445
+
442
446
[ connection-status-ng2-stompjs] : {% link _ posts/2018-12-18-connection-status-ng2-stompjs.md %}
0 commit comments