【发布时间】:2019-09-17 16:06:00
【问题描述】:
我想应用角度组件
import { Component } from '@angular/core'
import { DialogService } from './dialog/dialog.service'
@Component({
selector: 'app-root',
templateUrl: '<div></div>',
})
export class AppComponent {
dialogs: any;
constructor(public dialogService: DialogService) {
dialogs = dialogService.getDialogs();
// dialogs are like following =
// { "id": 1, "name": "D1", component: "<x-component>…</x-component>" },
}
}
对话框服务获取包含组件 html 的 JSON 数据。如何在现有组件上添加此 (<x-component>) 组件?
【问题讨论】: