I have service and method getCategory() for get category from server.
Method is :
getCategory(): Observable<CategoryModel[]> {
return this.http.get<CategoryModel[]> (this.productUrl)
.pipe(
catchError(this.handleError('getHeroes', []))
);
}
In my component I want store data in list categoryList: CategoryModel[];
with method
getCategory(): void {
this.dataStorageServiceService.getCategory()
.subscribe(
(cateogrys: CategoryModel[]) => {
this.categoryList = cateogrys;
console.log(this.categoryList)
}
}
And in outputcategoryList
is Object, and I can not render on the template.
Object.values?