Trying to fetch data from a lengthy path has proven challenging for me. I attempted to store the path in a variable and incorporate it into the template, but encountered some issues.
Could someone assist me with this?
Here is what I have tried:
My stored path : propBasePath:string =
${header.label.lacales}
When I attempt to log like this:
this.appProps = value;
console.log( this.appProps[this.propBasePath]['th_TH'] ) //this doesn't work!!
console.log( this.appProps.header.label.lacales.th_TH ) it works.
In the template:
<h1 style="font-size: 3rem">{{appProps[propBasePath].th_TH}}</h1>
Even the above method isn't successful. I realize that my approach to accessing the data might be incorrect. Can anyone please point out the mistakes?
I am also encountering this error
ERROR ReferenceError: header is not defined