Angular 2 - Rxjs Intelligent with VS 2015 update 3

2019-09-11 04:47发布

问题:

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';