Skip to content

Instantly share code, notes, and snippets.

@ldmarz
Last active August 21, 2018 14:26
Show Gist options
  • Select an option

  • Save ldmarz/e038c13909b5673d7048477142d96fc6 to your computer and use it in GitHub Desktop.

Select an option

Save ldmarz/e038c13909b5673d7048477142d96fc6 to your computer and use it in GitHub Desktop.
Example of lazy loaders on Angular
import { HomePage } from '../pages/home/home';
@NgModule({
declarations: [
MyApp,
HomePage
],
. . .
entryComponents: [
MyApp,
HomePage
]
})
import { IonicPage } from 'ionic-angular';
@IonicPage()
@Component( ... )
export class HomePage { ... }
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { HomePage } from './home';
@NgModule({
declarations: [HomePage],
imports: [IonicPageModule.forChild(HomePage)],
})
export class HomePageModule { }
@NgModule({
declarations: [
MyApp
],
. . .
entryComponents: [
MyApp
]
})
ionic start lazy-loader blank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment