I have a pipe that returns an observable of type Observable , and I want to call this pipe from my typescript file.
**Pipe.ts**
export class Pipe {
transform(sometihng$: Observable<SomeType>, key: string): **Observable<string>** {
return sometihng$.pipe(
map((sometihngs: SomeType) => sometihngs[this.service.getValue(key.toString())])
);
}
}
I want to call this pipe from my ts file by creating a method that returns a string :
functionToGetValue(): String {
// returns StringFromObservable;
}
I don't know how the body of the function should be defined , I know how to return an observable by using the pipe , but I don't know how to return a string after subscribing to the observable.