Is it possible to use a component without re-importing it if it's already declared in AppModule? With 10 or more pages/components to manage, importing each one can be challenging.
Here is my app.module.ts
import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
@NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: [
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}
I want to use HomePage without importing it again, considering the number of pages I need to handle.
other-page.ts
import { Component } from '@angular/core';
@Component({
selector: 'page-home',
templateUrl: 'login.html',
providers: [LoginService]
})
export class LoginPage {
constructor(){ }
//Call HomePage here without having to import it again.
}