【发布时间】:2017-12-12 13:07:12
【问题描述】:
下面是我的代码,如何在其他组件中使用(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 中使用过,但我想在其他组件中使用这个响应。
【问题讨论】:
标签: angular typescript ionic-framework