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);
}
}
存在しません:あなたはこのように演算子を追加する必要がプロパティ 'toPromise' '観察可能<Response>' タイプで、私はこのエラーになっています
Property 'toPromise' does not exist on type 'Observable'.any
経由typescriptですのバージョンを更新することでこの問題を解決することができます。 Observablesはもっと強力です – Dinistro