Exploit
Exploit

Reputation: 108

RxJS Subject gives me a (SystemJS) Unexpected token <(…)

I got this typescript code:

_live: Subject<Match[]> = new BehaviorSubject<Match[]>(null);
_pre: Subject<Match[]> = new BehaviorSubject<Match[]>(null);

But I keeps getting this Error:

(SystemJS) Unexpected token <(…).

When those 2 variables are removed everything else works fine. Is there a fix for this or something else that replace Subject?

Upvotes: 1

Views: 730

Answers (1)

Sanket
Sanket

Reputation: 20017

Try importing Subject like this-

import { Subject }          from 'rxjs/Subject';

or import everything from RxJS like this-

import 'rxjs/Rx'; 
// adds ALL RxJS statics & operators to Observable

See if this helps.

Upvotes: 1

Related Questions