DynamicComponent.ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-dynamic',
templateUrl: './dynamic.component.html',
styleUrls: ['./dynamic.component.scss']
})
export class DynamicComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
app.html
<h1> dynamic component</h1>
<ng-container #demosContainer>
angular中动态创建组件
最新推荐文章于 2023-02-26 15:43:43 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)