我已经使用Angular 6创建了一个库并成功构建了它。 将模块( AdjudicationHistoriqueModule )添加到库模块后,在构建库时会出现以下错误:
TypeError: Cannot read property 'isSkipSelf' of null
at ProviderElementContext._getDependency (C:\Users\taha.manar\Documents\workspace\ADJUDICATION-IHM\node_modules\@angular\compiler\bundles\compiler.umd.js:11483:22)
at C:\Users\taha.manar\Documents\workspace\ADJUDICATION-IHM\node_modules\@angular\compiler\bundles\compiler.umd.js:11428:64
at Array.map (<anonymous>)
at C:\Users\taha.manar\Documents\workspace\ADJUDICATION-IHM\node_modules\@angular\compiler\bundles\compiler.umd.js:11428:30
...
将下面的行添加到pulic_api.ts文件中时,我也遇到相同的错误
export * from './lib/historique/adjudication-historique.module';
adjudication-historique.module.ts
import { AlmCommonModule } from './../Common/alm-common.module';
import { AlmRootPageModule } from './../Common/root-page/root-page.module';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { AdjudicationHistoriqueRoutingModule } from './adjudication-historique-routing.module';
import { HistoriqueComponent } from './historique.component';
import { AdjudicationStructHistoriqueComponent } from './adjudication-struct-historique.component';
import { HistoriqueService } from './historique.service';
@NgModule({
imports: [
CommonModule,AdjudicationHistoriqueRoutingModule,AlmRootPageModule,AlmCommonModule
],
declarations: [HistoriqueComponent,AdjudicationStructHistoriqueComponent]
,
providers : [HistoriqueService]
})
export class AdjudicationHistoriqueModule { }
adjudication.module.ts(库模块)
import { HistoriqueService } from './historique/historique.service';
import { NgModule } from '@angular/core';
import { AdjudicationComponent } from './adjudication.component';
@NgModule({
imports: [
],
declarations: [AdjudicationComponent],
exports: [AdjudicationComponent],
providers: [HistoriqueService]
})
export class AdjudicationModule { }
P.S:我正在将项目从Angular 4升级到Angular 6