-3
would like to know if it is possible to display one object inside another at angle 8.
In case I have the property of the employee and within it has a department object with other properties.
I’d like to display the employee details and the name of the department he works in. But when using ngFor to iterate either it returns [Object Object] or returns blank field. And the employee has the registered department, po rme does not show on screen. Below the photos of the Employee and Department classes and the HTML page.
Hi Josemar, so when I put this way <th>{{ func.departmento.name }}</th> the field is blank on the screen, with no information.
– Lucas Mello
Then the object has not been filled. Try to give a
console.log
to see if it is filled correctly or use a{{ func.departamento.nome | json }}
to see directly in the template.– Josemar Silva
Really the object was empty. In the registration screen I had not put the property in [value], I had left as object. Thanks for the help Josemar.
– Lucas Mello