I try to build an ionic 2 app. When I try the app in the browser with ionic serve or launch it on an emulator everything works fine.
But when I try to build it every
Since the Ionic 3.6.0 release every page generated using Ionic-CLI is now an Angular module.
This means you've to add the module to your imports in the file src/app/app.module.ts
import { BrowserModule } from "@angular/platform-browser";
import { ErrorHandler, NgModule } from "@angular/core";
import { IonicApp, IonicErrorHandler, IonicModule } from "ionic-angular";
import { SplashScreen } from "@ionic-native/splash-screen";
import { StatusBar } from "@ionic-native/status-bar";;
import { MyApp } from "./app.component";
import { HomePage } from "../pages/home/home"; // import the page
import {HomePageModule} from "../pages/home/home.module"; // import the module
@NgModule({
declarations: [
MyApp,
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
HomePageModule // declare the module
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage, // declare the page
],
providers: [
StatusBar,
SplashScreen,
{ provide: ErrorHandler, useClass: IonicErrorHandler },
]
})
export class AppModule {}