Angular动态组件

一、主页面:

app.component.html:

1  <button (click)="load();">动态</button>
2 2<div #domRoom><!--动态组件加载到这个div里--></div>
View Code