La propiedad 'toPromise' no existe en el tipo 'Observable <Response>'
import { Headers, Http } from '@angular/http';
@Injectable()
export class PublisherService{
private publishersUrl = 'app/publisher';
constructor(private http: Http) { }
getPublishers(): Promise<Publisher[]>{
return this.http.get(this.publishersUrl)
.toPromise()
.then(response => response.json().data)
.catch(this.handleError);
}
}
Recibo este error:
La propiedad 'toPromise' no existe en el tipo 'Observable'.any