【发布时间】:2017-10-11 21:59:18
【问题描述】:
有没有一种很好的“通用”方法从该方法返回object:
getItems(){
this.itemService.getAllWithPaging(this.params)
.subscribe(res => {
this.itemsAndPageableInfo = res;
});
}
然后以一种不错的方式显示sub objects?
当我尝试显示.number 时出现错误,这是undefined。 itemsAndPageableInfo 声明如下:itemsAndPageableInfo : any;。所以这可能是object 等,但我没有定义sub objects 和其他属性。有没有办法不定义所有这些sub objects 和显示或使用sub object,进一步属性?
当然,我不想在显示或使用它之前定义所有这些sub objects 和其他属性。
【问题讨论】:
标签: angular httpclient response