angular2-dashboard-starter icon indicating copy to clipboard operation
angular2-dashboard-starter copied to clipboard

TypeError: Observable_1.Observable.throw is not a function

Open p3140 opened this issue 8 years ago • 4 comments

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

p3140 avatar Mar 13 '16 22:03 p3140

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

PostImpatica avatar Sep 02 '16 13:09 PostImpatica

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

kevin-king avatar Jan 16 '17 19:01 kevin-king

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

javagose avatar May 02 '17 10:05 javagose

@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

naveedahmed1 avatar Aug 28 '17 20:08 naveedahmed1