1

这似乎是“@angular/common”模块和常春藤编译器的问题?有任何想法吗?删除 node_modules 并更新 angular 没有任何成功。

        <!-- Define our template -->
        <ng-template #myTemplate> World! </ng-template>

        Hello
        <!-- Render the template in this outlet -->
        <ng-container [ngTemplateOutlet]="myTemplate"></ng-container>

如果我尝试 ...*ngTemplateOutlet=... 那么我在运行时收到此错误:NG0303: Can't bind to 'ngTemplateOutlet' 因为它不是 'ng-container' 的已知属性。node_modules/@angular/core/ivy_ngcc/fesm2015/core.js : 10073

角度版本 11

4

1 回答 1

1

这是 DevExtreme 模板中 app.module.ts (实际上是导入的BrowserModule)和 app-routing.module.ts 的混淆。在我添加BrowserModule后它app-routing.module.ts@NgModule({ imports:预期工作。@Ilia Komarov:谢谢!您的解决方案也是正确的!

于 2021-03-19T22:28:47.677 回答