Having a function like this:
getCategories(): Observable<any>
{
return this.category.find({where: {clientId: this.userApi.getCurrentId()}})
};
The return type of this.category.find is Observable<T[]>
.
When I invoke getCategories() using the following code:
const source = this.categoryService.getCategories();
const example = source.map(Categ=> Categ.id);
const subscribe = example.subscribe(val => console.log(val));
The result shows that Categ.id is undefined
If I directly run:
const source = this.categoryService.getCategories();
const subscribe = source.subscribe(val => console.log(val));
The output is shown here: https://i.sstatic.net/uROvf.png
I suspect there might be a typing issue somewhere, but I can't pinpoint it.
Any suggestions?
Thanks and Best Regards,