代码之家  ›  专栏  ›  技术社区  ›  Medhat Mahmoud

Angular Cli警告:不推荐使用“entryComponent”选项:由于9.0.0版带有Ivy,entryComponents不再是必需的

  •  0
  • Medhat Mahmoud  · 技术社区  · 5 年前

    我正在使用Angular Cli创建组件。

    我正在使用这个命令:

    ng g c DeviceComponent --module=./views/administration/Accounting.module.ts --spec=false --flat
    

    我收到了警告:

    Option "entryComponent" is deprecated: Since version 9.0.0 with Ivy, entryComponents is no longer necessary.
    

    而且组件没有被创建 我的观点是:

    Angular CLI: 10.2.0
    Node: 12.18.3
    OS: win32 x64
    
    Angular: 10.2.0
    ... animations, cli, common, compiler, compiler-cli, core, forms
    ... language-service, platform-browser, platform-browser-dynamic
    ... router
    Ivy Workspace: Yes
    
    Package                         Version
    ---------------------------------------------------------
    @angular-devkit/architect       0.1000.8
    @angular-devkit/build-angular   0.1000.8
    @angular-devkit/core            10.0.8
    @angular-devkit/schematics      10.2.0
    @angular/cdk                    10.2.5
    @schematics/angular             10.2.0
    @schematics/update              0.1002.0
    rxjs                            6.6.3
    typescript                      3.9.7
    

    我读过这篇文章,但它对我没有帮助 Nativescript error 'Cannot read property 'kind' of undefined' when run 'ng generate component'

    我做完了

     npm install --save-dev typescript@4
    

    但这是同样的错误

    有人能帮我吗?

    0 回复  |  直到 5 年前
        1
  •  -1
  •   Filip    5 年前

    我想你在用 entryComponent 在你的一个模块里。在早期版本的angular中动态渲染角度组件(模态、弹出窗口)时,这是必要的。