I want to have an exported function that returns a string, but I can't make it work, because I have a subscribe inside the function.
export function translateBreadcrumbSelf(key: string): string {
this.translateService.get(key).subscribe(
(result: string) => {
return result;
}
);
}
How can I return the result string? I understand that this is an async call, so is it even possible to do this?