Ich brauche atmosphäre.js in meinem eckigen 5 Projekt.Angular 5 und atmosphere.js
Ich habe diese Schritte getan:
npm install --save @types/atmosphere.js
npm install --save atmosphere.js
und ich habe einen Dienst erstellt:
import { Injectable } from '@angular/core';
import * as Rx from 'rxjs';
import * as Atmosphere from 'atmosphere.js';
import {Subject} from 'rxjs/Subject';
@Injectable()
export class WebsocketService {
public eventsSubject: Rx.Subject<any> = new Rx.Subject<any>();
private url:string = "http://localhost:4200/ws/register";
private socket: Atmosphere.Atmosphere;
private subSocket: any;
private request: Atmosphere.Request;
public dataStream: Subject<any> = new Subject<any>();
constructor() {
...
try {
this.subSocket = this.socket.subscribe(this.request);
} catch (e) {
console.log("Error: " + e);
}
}
aber die Buchse ist immer undefiniert.
wo ist mein Fehler?
dank
groß es funktioniert. Tnx –