gpt4 book ai didi

angular - 无法绑定(bind)到 'ngOutletContext',因为它不是 'ng-template' 的已知属性

转载 作者:太空狗 更新时间:2023-10-29 17:00:46 25 4
gpt4 key购买 nike

<分区>

下面在 Angular 4 中运行良好

<ng-container *ngFor="let user of list_users">
<div *ngIf="currentUser.username !== user.username">
<div class="card">
bla bla
</div>
</div>
</ng-container>

Angular 5 提示这个错误:

Can't bind to 'ngOutletContext' since it isn't a known property of 'ng-template'.
1. If 'ngOutletContext' is an Angular directive, then add 'CommonModule' to the '@NgModule.imports' of this component.
2. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
<!-- CUSTOM TEMPLATE -->
<ng-template
[ERROR ->][ngOutletContext]="{ item: model, index: index }"
[ngTemplateOutlet]="template">
"): ng:///TagInputModule/TagComponent.html@12:12
Property binding ngOutletContext not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations". ("div *ngSwitchCase="true" [attr.contenteditable]="editing">
<!-- CUSTOM TEMPLATE -->
[ERROR ->]<ng-template
[ngOutletContext]="{ item: model, index: index }"
[ngTemplateOut"): ng:///TagInputModule/TagComponent.html@11:8
at syntaxError (compiler.js:466)
at TemplateParser.parse (compiler.js:24314)
at JitCompiler._parseTemplate (compiler.js:33701)
at JitCompiler._compileTemplate (compiler.js:33676)
at eval (compiler.js:33578)
at Set.forEach (<anonymous>)
at JitCompiler._compileComponents (compiler.js:33578)
at eval (compiler.js:33448)
at Object.then (compiler.js:455)
at JitCompiler._compileModuleAndComponents (compiler.js:33447)

查看升级步骤:https://angular-update-guide.firebaseapp.com/ ,我似乎没有任何与ng-template相关的东西

另外,这是我使用的代码中唯一的地方 <ng-template></ng-template>

我该如何进行?

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