【发布时间】:2019-06-16 15:34:14
【问题描述】:
我有一个名为 AppComponent 的 Angular 容器组件。我想在 AppComponent 中加载我的非角度组件 HelloComponent。
我的实际目标是将现有的旧组件加载到 Angular 6 组件中。
export class HelloComponent extends HTMLElement {
constructor() {
super();
}
connectedCallback() {
this.innerHtml = `<h1>Native component loaded successfully</h1>`;
//init and load component.
}
}
我的角码如下:
<angular-app>
<hello-comp></hello-com>
</angular-app>
如何将这个 HelloComponent 注入到这个类中。
html customElements 不起作用。
【问题讨论】:
-
如果@Intervalia 回答了您的问题,请接受他的回答。本网站基于社区对贡献的认可。
标签: angular web-component micro-frontend