hasanhameed07 / angular2-dashboard-starter

MIT License
97 stars 46 forks source link

TypeError: Observable_1.Observable.throw is not a function #3

Open p3140 opened 8 years ago

p3140 commented 8 years ago

Hi. In file data.service.ts you need to add import 'rxjs/Rx'; for handleError to work. Greetings.

PostImpatica commented 8 years ago

instead of using the whole library, it's best to use: import 'rxjs/add/observable/throw';

kevin-king commented 7 years ago

Just in case this saves someone a couple minutes, make sure to do import 'rxjs/add/observable/throw'; and not import 'rxjs/add/operator/throw';.

javagose commented 7 years ago

You should import Observable from rxjs/RX instead of rxjs/Observable, pulling it this way automatigically get you all of the operators ('map', throw...) import {Observable} from 'rxjs/Rx';

naveedahmed1 commented 7 years ago

@javagose please take a look at the below comment by owner of rxjs, you shouldn't import Observable from rxjs/Rx:

https://github.com/ReactiveX/rxjs/issues/1866#issuecomment-302244695