当前位置: 动力学知识库 > 问答 > 编程问答 >

angular2 - 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?

网友答案:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: