Actually it is printing the correct output in the UI. But in the console it is displaying a type error?... How can I resolve this?
<tr>
<th scope="row">IP addrress</th>
<td>{{deviceinfo['ip-address']}}</td>
</tr>
ERROR TypeError: Cannot read property 'ip-address' of undefined
this may happen in case deviceinfo was not assign yet as example you get the value by http request
you can use ngIf to display the deviceinfo information when it has a value or truthy
another option is to set deviceinfo property to empty object
component