public observableA = (id: string): Observable<Array<any>>=>{
}
public observableB = (id: string): Observable<Array<myClass>>=>{
observableA(metroId).map((x)=>{
return new myClass(
x.FacilityName,
x.ID)
};
}
export class myClass{
ID: string;
Name: string;
constructor(id: string, name: string){this.ID=id;this.Name=name;}
}
ObservableA returns an array of objects, I'm writing a function ObservableB to return an array of myClass using the returned array of ObservableA.
When I debug this code, What I can see is 'x' in the map parameter is the entire array from ObservableA, rather than the object elements of the array.
so the properties can't be accessed.
What could be wrong?
Update: Is there a way to make the single Observable of Array to an array of Observables so I can process the elements?