简体   繁体   English

NG0303:无法绑定到“ngIf”,因为它不是“div”的已知属性:Angular Modular Federation

[英]NG0303: Can't bind to 'ngIf' since it isn't a known property of 'div' : Angular Modular Federation

NG0303: Can't bind to 'ngIf' since it isn't a known property of 'div' (used in the 'HomeComponent' component template). NG0303:无法绑定到“ngIf”,因为它不是“div”的已知属性(在“HomeComponent”组件模板中使用)。 If the 'ngIf' is an Angular control flow directive, please make sure that either the 'NgIf' directive or the 'CommonModule' is a part of an @NgModule where this component is declared.如果“ngIf”是 Angular 控制流指令,请确保“NgIf”指令或“CommonModule”是声明此组件的@NgModule 的一部分。

MFE- Exposed - HomeModule MFE- 外露 - HomeModule

imports: [
    CommonModule,
    HomeRoutingModule,
    AngularMaterialModule,
    ReactiveFormsModule,
    FormsModule,
    SharedComponentsModule,
    LanguageTranslateModule,
    NumericOnlyModule,
    NgSelectModule,
    ToolTipmatModule

  ],

While Trying in shell Application giving this error在 shell 应用程序中尝试时出现此错误

MFE is an Angular 13 MFE是Angular 13

Shell is an Angular 14 Shell 是 Angular 14

it should be *ngIf or [ngIf] not plain ngIf它应该是 *ngIf 或 [ngIf] 而不是普通的 ngIf

It was CommonModule这是 CommonModule

issue importing commonmodule and removing BrowserModule worked!!导入 commonmodule 和删除 BrowserModule 的问题有效!!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 NG0303:无法绑定到“ngif”,因为它不是“div”的已知属性 - NG0303: Can't bind to 'ngif' since it isn't a known property of 'div' Angular - NgIf 无法在组件上工作:“NG0303:无法绑定到‘ngIf’,因为它不是‘p’的已知属性。” - Angular - NgIf not working on component: "NG0303: Can't bind to 'ngIf' since it isn't a known property of 'p'." NG0303:无法绑定到“ngIf”,因为它不是“mat-error”的已知属性 - NG0303: Can't bind to 'ngIf' since it isn't a known property of 'mat-error' NG0303:无法绑定到“ngIf”,因为它不是“[组件选择器]”的已知属性 - NG0303: Can't bind to 'ngIf' since it isn't a known property of '[component selector]' jasmine thorw 错误:'NG0303:无法绑定到'选项',因为它不是'div'的已知属性。' - jasmine thorw ERROR: 'NG0303: Can't bind to 'options' since it isn't a known property of 'div'.' Angular11 - NG0303:无法绑定到“ngForOf”,因为它不是“tr”的已知属性 - Angular11 - NG0303: Can't bind to 'ngForOf' since it isn't a known property of 'tr' NG0303:无法绑定到“ngbTooltip”,因为它不是“button”的已知属性 - NG0303: Can't bind to 'ngbTooltip' since it isn't a known property of 'button' NG0303:无法绑定到“matTreeNodeDefWhen”,因为它不是“mat-tree-node”的已知属性 - NG0303: Can't bind to 'matTreeNodeDefWhen' since it isn't a known property of 'mat-tree-node' core.mjs:10144 NG0303: 无法绑定到“ngForOfOf”,因为它不是“div”的已知属性 - core.mjs:10144 NG0303: Can't bind to 'ngForOfOf' since it isn't a known property of 'div' NG0303:无法绑定到“ngModel”,因为它不是“离子范围”的已知属性 - NG0303: Can't bind to 'ngModel' since it isn't a known property of 'ion-range'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM