I am attempting to execute and retrieve values from an array of observables (each obtained from literalsService
) using a pipe. Below is the code snippet:
translateLiterals() {
const literalsToTranslate: string[] = [
'certificate_title',
'with_address',
'hereby',
'declare',
'electronic_records',
'proceeded_to_shipment',
'return_address',
'return_address',
'addressee',
'message_subject',
];
const newArray: Observable<string>[] = [];
literalsToTranslate.map(literal => newArray.push(this.literalsService.getValue('Ngwa.Ngwa', literal)));
this.literalsArray$ = forkJoin([...newArray]).pipe(map((results) => {
console.log(results);
return results;
}));
}
In my HTML template, I am subscribed to the pipe with:
<ng-container *ngIf="literalsArray$ | async"></ng-container>
However, the console.log()
does not display anything... Any ideas why?