Обновите Ngx-admin до Angular 9

Я пытаюсь обновить свой проект на основе администратора ngx с angular 8 до 9. Я следую руководству angular.io, а также выполняю этот шаг, предложенный руководством:

"If you are a library author and you had a method returning ModuleWithProviders (typically via a method named forRoot()), you will need to specify the generic type. Learn more angular.io"

Затем я обновляю все компоненты Nebular до версии 5.0.0. Затем я обновляю ng2-smart-table до версии 1.6, удаляю ng2-completer и устанавливаю @akveo/ng2-completer. (см. https://github.com/akveo/ng2-smart-table/pull/1140)

Теперь, запустив ng serve, у меня есть эти ошибки:

ERROR in src/app/pages/pages.module.ts:22:12 - error NG1010: Value at position 4 in the NgModule.imports of PagesModule is not a reference: [object Object] 

 22   imports: [
               ~
 23     PagesRoutingModule,
    ~~~~~~~~~~~~~~~~~~~~~~~
...
 27     AuthModule.forRoot(),
    ~~~~~~~~~~~~~~~~~~~~~~~~~
 28   ],
    ~~~
src/app/app.module.ts:39:12 - error NG1010: Value at position 4 in the NgModule.imports of AppModule is not a reference: [object Object]

 39   imports: [
               ~
 40     BrowserModule,
    ~~~~~~~~~~~~~~~~~~
...
 57     CoreModule.forRoot(),
    ~~~~~~~~~~~~~~~~~~~~~~~~~
 58   ],
    ~~~
src/app/app.component.ts:13:14 - error NG8001: 'router-outlet' is not a known element:
1. If 'router-outlet' is an Angular component, then verify that it is part of this module.
2. If 'router-outlet' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

13   template: '<router-outlet></router-outlet>',
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/pages/pages.component.ts:18:5 - error NG8001: 'ngx-one-column-layout' is not a known element:
1. If 'ngx-one-column-layout' is an Angular component, then verify that it is part of this module.
2. If 'ngx-one-column-layout' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.   

18     <ngx-one-column-layout>
       ~~~~~~~~~~~~~~~~~~~~~~~
src/app/pages/pages.component.tsm:19:7 - error NG8001: 'nb-menu' is not a known element:
1. If 'nb-menu' is an Angular component, then verify that it is part of this module.
2. If 'nb-menu' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

19       <nb-menu [items]="menu"></nb-menu>
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/app/pages/pages.component.ts:19:16 - error NG8002: Can't bind to 'items' since it isn't a known property of 'nb-menu'.
1. If 'nb-menu' is an Angular component and it has 'items' input, then verify that it is part of this module.
2. If 'nb-menu' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

19       <nb-menu [items]="menu"></nb-menu>
                  ~~~~~~~~~~~~~~
src/app/pages/pages.component.ts:20:7 - error NG8001: 'router-outlet' is not a known element:
2. If 'router-outlet' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

20       <router-outlet></router-outlet>
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

В чем проблема?

заранее большое спасибо

Андреа


person andreat    schedule 27.03.2020    source источник
comment
эй, ты нашел решение? У меня точно такая же проблема   -  person Mithrand1r    schedule 05.04.2020
comment
привет, теперь основная ветка обновляется до угловых 9 и туманных 5. Попробуйте выполнить этот github. com/akveo/ngx-admin/pull/5628   -  person andreat    schedule 06.04.2020


Ответы (1)


Платформа NGX-Admin в настоящее время несовместима с angular 9.

В package.json официального репозитория вы можете видеть, что упоминается только angular 8: https://github.com/akveo/ngx-admin/blob/master/package.json#L35

Однако уже есть запрос на обновление до angular 9 и nebular 5: https://github.com/akveo/ngx-admin/pull/5628

Вы можете дождаться слияния этого запроса на извлечение или попробовать портировать весь фреймворк самостоятельно.

Для получения информации о том, как перейти с angular 8 на 9, перейдите по следующему адресу: https://update.angular.io/

person kacase    schedule 27.03.2020
comment
Существует ветка обновления github.com/akveo/ngx-admin /tree/upgrade-to-ng9-nebular5, который отлично работает. Nebular v5 совместим с ng9. Спасибо - person andreat; 27.03.2020