Here is the simplified demo.
Is there a simply way to print in template the value of specific element from Array in Observable? The thing is that I have a list of key-value pairs where keys have some specific structure and they can be different between each key. And I'm wondering if is there any way to create some kind of converter to object where fields would be the keys' literals. Or is there nice solution to retrieve value by passing the key, but so it could be used on the template and component. So for example extract value for given key directly from labels$.
In given demo, I have method filterLabels(key: string) which works fine when I'm using it in component. But it would lead to a lot of variables for each label etc. When I tried to call this method from template then it entered endless loop...
Disclaimer: for some reason, the json doesn't want to be downloaded inside labels.service.ts with commented code, where similar code works on my original application.
EDIT:
New demo.
I've tried to reduce the json to map. But don't understand why it is working for console.log(mapAccumulator['labels.header.defaultTitle']); and doesn't work in the template <h1>{{ convertedLabels$['labels.header.defaultTitle'] | async }}</h1>.
convertedLabels$an observable?