作品: ionic cordova build ios
イオン3モジュールの宣言エラー
しかし、実行している次のエラー
Error: Type ExpandableHeaderComponent in /Users/jobstore/jobstore/js/src/components/expandable-header/expandable-header.ts is part of the declarations of 2 modules: SharedModuleComponent in /Users/jobstore/jobstore/js/src/components/shared-module/shared-module.ts and ExpandableHeaderComponentModule in /Users/jobstore/jobstore/js/src/components/expandable-header/expandable-header.module.ts! Please consider moving ExpandableHeaderComponent in /Users/jobstore/jobstore/js/src/components/expandable-header/expandable-header.ts to a higher module that imports SharedModuleComponent in /Users/jobstore/jobstore/js/src/components/shared-module/shared-module.ts and ExpandableHeaderComponentModule in /Users/jobstore/jobstore/js/src/components/expandable-header/expandable-header.module.ts. You can also create a new NgModule that exports and includes ExpandableHeaderComponent in /Users/jobstore/jobstore/js/src/components/expandable-header/expandable-header.ts then import that NgModule in SharedModuleComponent in /Users/jobstore/jobstore/js/src/components/shared-module/shared-module.ts and ExpandableHeaderComponentModule in /Users/jobstore/jobstore/js/src/components/expandable-header/expandable-header.module.ts.
で、次の
ionic cordova build ios --prod
結果は私が共有モジュールを作成してみました:
import { Component ,NgModule} from '@angular/core';
import {ExpandableHeaderComponent} from '../expandable-header/expandable-header';
import {ShrinkHeaderComponent} from '../shrink-header/shrink-header';
@Component({
selector: 'shared-module',
templateUrl: 'shared-module.html'
})
@NgModule({
declarations: [
ExpandableHeaderComponent,
ShrinkHeaderComponent
],
exports: [
ExpandableHeaderComponent,
ShrinkHeaderComponent
]
})
export class SharedModuleComponent {
constructor() {
}
}
とapp.module.tsここ
import { SharedModuleComponent } from '../components/shared-module/shared-module';
、ここ
imports: [
BrowserModule,
HttpModule,
SharedModuleComponent,
],
でそれをインポートするが、私はまだ同じ問題に直面しています。
エラーの内容は正確に記載されています。ここで不明な点は何ですか? – yurzui
ComponentsModuleを表示できますか? – brijmcq
@yurzui、ちょうど私に理解を助けることができます – noor