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

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

@Injectable()
export class PublisherService{

    private publishersUrl =          


        
3条回答
  •  鱼传尺愫
    2020-12-02 22:22

    Try adding 'Response' to your import statement from '@angular/http' like this :

    import {Http, Headers, Response} from '@angular/http';
    

    Also i noticed you don't import Ingectable from angular core although you use @Injectable decorator.

    import { Injectable } from '@angular/core';
    

提交回复
热议问题