Dynamically adding components in ngFor

后端 未结 4 932
感情败类
感情败类 2020-12-08 11:33

I have a \"dashboard\" that loads configured elements. Dashboard template has this:

  
4条回答
  •  无人及你
    2020-12-08 11:47

    After

    if (cmpRef.instance.hasOwnProperty('title')) {
       cmpRef.instance.title = conf.title;
    }
    

    You can add this.cd.detectChanges(); or you will have the error "ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked" in your children component with Angular 6x.

提交回复
热议问题