Angular 2 - Rxjs Intelligent with VS 2015 update 3

你离开我真会死。 提交于 2019-12-25 07:59:00

问题


I am learning the Angular 2.

I am following exactly the tutorial Tour of Heroes (https://angular.io/docs/ts/latest/tutorial/), I have everything work just fine.

Just one thing, it looks like the VS 2015 (with update 3) doesn't recognize extension functions from the Rxjs, can you advise how to fix it?

I have all imported as in the tutorial

// Observable class extensions
import 'rxjs/add/observable/of';
import 'rxjs/add/observable/throw';

// Observable operators
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';
import 'rxjs/add/operator/do';
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/switchMap';

a note while checking the file rxjs/add/operator/debounce.d.ts the observable founder is not found, in fact the folder is there


回答1:


Try this:

import {Subject, Observable} from 'rxjs/Rx'; 


来源:https://stackoverflow.com/questions/40078602/angular-2-rxjs-intelligent-with-vs-2015-update-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!