Skip to content

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

@coloz

Description

@coloz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions