I have developed a collaborative module where I declared and exported the necessary component for use in other modules.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DateslideComponent } from './dateslide/dateslide.component';
import { IonicModule } from '@ionic/angular';
import { TimeslideComponent } from './timeslide/timeslide.component';
import { AddtimeComponent } from './addtime/addtime.component'
@NgModule({
declarations: [DateslideComponent, TimeslideComponent, AddtimeComponent],
imports: [
CommonModule,
IonicModule
],
exports: [DateslideComponent, TimeslideComponent, AddtimeComponent]
})
export class TimeModule { }
In another module, I imported the shared module as follows:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { WhenPageRoutingModule } from './when-routing.module';
import { WhenPage } from './when.page';
import {TimeModule} from '../../timemodule/time.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
WhenPageRoutingModule,
TimeModule
],
declarations: [WhenPage ]
})
export class WhenPageModule {}
Within one of the components of the second module, I tried to import a component from the shared module but encountered the following error:
import { AddtimeComponent } from '../../timemodule/time.module'
The module declares the component locally, but it is not being exported.