简体   繁体   English

更改后,我的状态视图在以 angular 8 重新加载我的页面之前不会更新

[英]After change my status view is not update before reload my page in angular 8

I am new in angular my view is not updated automatically whenever I changed my view but view is not updated before I reload my whole page or hit my api call then my view is updated.我是 angular 的新手,每当我更改视图时,我的视图都不会自动更新,但是在我重新加载整个页面或点击我的 api 调用之前,视图不会更新,然后我的视图会更新。 Thank you in advance先感谢您

You are updating a nested object and it is passed as an input to a child component?您正在更新嵌套对象并将其作为输入传递给子组件? In that case, the child component doesn't recognize the property as updated.在这种情况下,子组件不会将该属性识别为已更新。 Each time you update the property, you need to assign as newly:每次更新属性时,都需要重新分配:

this.updatingProperty = Object.assign({}, this.updatingProperty);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM