kittencup / angular2-ama-cn

angular2 随便问
692 stars 101 forks source link

创建动态组件后,调用componentRef.instance不能更新界面数据 #268

Open coloz opened 6 years ago

coloz commented 6 years ago

发现在动态组件创建后,使用动态组件的实例(componentRef.instance)去改变动态组件的属性,如: componentRef.instance.xxx="123" 界面上的绑定的{{xxx}},不会更新 但控制台输出得知,其中的xxx确实已经变更。 而直接在动态组件类中使用函数,可以改变xxx,且{{xxx}}实时更新了。 这难道是发现angular的bug了? 如果才能让使用componentRef时,绑定的数据实时更新呢?

JayzeeHuang commented 6 years ago

用NGZONE @coloz