【发布时间】:2022-07-28 16:07:17
【问题描述】:
我的 Angular 13 项目有一个延迟加载组件
async loadModals() {
this.viewContainerRef.clear();
const { McComponent } = await import('./components/modal/mc.component');
this.viewContainerRef.createComponent(this.componentFactoryResolver.resolveComponentFactory(McComponent));
}
但不知道如何在其中导入 RouterModule 以获得工作链接
<a [routerLink]="['/mcu']" class="upgrade-link">
{{ upgradeLinkLable | translate }}
</a>
【问题讨论】:
-
你能提供一个stackblitz的例子吗,这样我可以更容易地提供帮助
标签: angular