Ошибка получения после объявления компонента в соответствующем модуле angular 8 - PullRequest
1 голос
/ 26 января 2020

После объявления имени компонента в модуле я получаю сообщение об ошибке ниже

Вот мой учебный модуль, где у меня есть все связанные компоненты, которые я сопоставил здесь

    import { NgModule } from '@angular/core';
    import { CommonModule } from '@angular/common';
    import { StudyDetailsComponent } from './study-details.component';
    import { RouterModule } from '@angular/router';

    import { PartialsModule } from '../../partials/partials.module';
    import { CoreModule } from '../../../core/core.module';

    /* material components */
    import { MaterialModule } from '../../../shared/modules/material.module';
    /* import componenets for study details */
    import { BasicInformationComponent } from './basic-information/basic-information.component';
    import { MaintenanceComponent } from './maintenance/maintenance.component';
    import { ProcedureCostComponent } from './maintenance/procedure-cost/procedure-cost.component';
    import { CountryListComponent } from './maintenance/procedure-cost/country-list/country-list.component';
    import { StudyListComponent } from './maintenance/procedure-cost/country-list/study-list/study-list.component';
    import { MatchSiteComponent } from './match-site/match-site.component';
    import { FormsModule } from '@angular/forms';
    import { NgxFlagPickerModule } from 'ngx-flag-picker';
    import { DialogCTMSComponent } from './match-site/dialog-ctms/dialog-ctms.component';
    import { MatDialogModule } from '@angular/material';
    //import { DialogCTMSComponent } from '../study-details/match-site/dialog-ctms/dialog-ctms.component';



    @NgModule({
      declarations: [StudyDetailsComponent, BasicInformationComponent, MaintenanceComponent, ProcedureCostComponent, CountryListComponent, StudyListComponent, MatchSiteComponent ],
      imports: [PartialsModule, MaterialModule,MatDialogModule,
        CoreModule,FormsModule,NgxFlagPickerModule,

        CommonModule, RouterModule.forChild([
          {
            path: '',
            component: StudyDetailsComponent
          },
        ])
      ],

      entryComponents: [
        DialogCTMSComponent
      ],

Вот мой ошибка, которую я получаю

Error: Uncaught (in promise): Error: Component DialogCTMSComponent is not part of any NgModule or the 
module has not been imported into your module. Error: Component DialogCTMSComponent is not part of 
any NgModule or the module has not been imported into your module.

Пожалуйста, дайте мне знать, что я делаю не так здесь

1 Ответ

1 голос
/ 26 января 2020

Вы должны добавить его под декларации тоже

 declarations: [StudyDetailsComponent, BasicInformationComponent, MaintenanceComponent, ProcedureCostComponent, CountryListComponent, StudyListComponent, MatchSiteComponent, DialogCTMSComponent ],
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...