I am able to create observable from an array but its type is Observable<number> not Observable<number[]>
getUsers(ids: string[]): Observable<number[]> {
const arraySource = Observable.from([1, 2, 3, 4, 5]);
//output: 1,2,3,4,5
const subscribe = arraySource.subscribe(val => console.log(val));
let returnObserable = Observable.from([1, 2, 3, 4, 5]);
return returnObserable; //error at this line, because of the return type
}
Is there any other way to create observable other than from ?