I am working on an Ionic/Angular project and I am trying to eliminate the type checking issue in html file.
I have hTest variable in my .ts file like this
hTest: {[k:string]: {fn:string, ln:string}} = {'user1': {fn: 'f1', ln: 'l1'}, 'user2': {fn: 'f2', ln: 'l2'}};
Typescript seems happy with that. And I loop over to display them in my html view like this
But typescript doesn't understand what fn and ln are (underlines in red) when I access them with usr.value.fn or usr.value.ln in html as above with keyvalue pipe. However it prints them out correctly, as below, so it does get the values.
This my TS version tsc --version gives Version 4.1.3
using on Visual Studio
How can I make Typescript understand the fn and ln variables in html above and not have it show syntax error by underlining?
Thanks, Sanjay.