gpt4 book ai didi

javascript - 如何在 Angular 2中嵌套不同的模块

转载 作者:行者123 更新时间:2023-11-30 13:58:31 24 4
gpt4 key购买 nike

The app.module has the admin-layout.module.
The admin-layout.module has the parameters.module.
The parameters.module has the soa-date.Component.
But the property.component is in the admin-layout.module

我需要把 <app-soa-date></app-soa-date> property.component 中的选择器,但它给我一个 app-soa-date is not a known element 的错误。

<div class="card-body">
<div *ngIf="showSoaDate">
<app-soa-date></app-soa-date>
</div>
<div *ngIf="showOther">
Other
</div>
</div>

请看下图: enter image description here

谢谢。

最佳答案

您还需要在您的ParamatersModule 中导出组件

declarations: [
....
],
exports: [
SoaDateComponent
]

关于javascript - 如何在 Angular 2中嵌套不同的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56766641/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com