I am encountering an issue with my binding not updating, and I have a hypothesis on why it's occurring, but I'm unsure about how to resolve it.
Within my controller, there is a company
object that includes a property called user
, which may or may not contain the user information. This user is another object.
The problem arises when there is no user associated with the company. In the template, when attempting to display the user's name, I use the code
{{ companyCtrl.company.user.name || 'N/A' }}
. Therefore, it displays 'N/A' if there is no user. Later, when I assign a user and update the company.user
in the response, it is no longer null.
Despite this change, the template still shows 'N/A'. I suspect this might be due to the initial lack of binding because there was no user present at first.
However, I cannot confirm this theory. If I already had a user when the page loaded and simply changed the user, the name would correctly update in the template.