Property 'toPromise' does not exist on type 'Observable'

后端 未结 3 1114
死守一世寂寞
死守一世寂寞 2020-12-02 21:58
import { Headers, Http } from \'@angular/http\';

@Injectable()
export class PublisherService{

    private publishersUrl =          


        
3条回答
  •  一生所求
    2020-12-02 22:39

    You need to add the operator like this:

    import 'rxjs/add/operator/toPromise';
    

    This is needed for every rxjs operator you want to use.

提交回复
热议问题