0
下面是我在其他組件代碼,如何使用(this.categoryType)如何在其他組件中使用家庭組件數據?
getCategoryDetails(){
return this.http.get('ip/ramu/api/api/…')
.map((res:Response) => res.json());
}
上面的代碼。我正在使用webservice.ts
ngOnInit() { this.wsp.getCategoryDetails().subscribe(data => {
this.categoryType = data; });
}
上面的代碼,我在home.ts使用,但我想在其他組件中使用此響應。
服務工作像魅力 –