Skip to content

Instantly share code, notes, and snippets.

@fkromer
Last active March 19, 2021 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fkromer/2746d0513dc5b7a91852786400219e2f to your computer and use it in GitHub Desktop.
Save fkromer/2746d0513dc5b7a91852786400219e2f to your computer and use it in GitHub Desktop.
const routes: Routes = [
{
...,
+ {
+ path: 'blub',
+ loadChildren: () => import('./blub/blub.module').then( m => m.BlubPageModule)
+ }
];
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { BlubPage } from './blub.page';
const routes: Routes = [
{
path: '',
component: BlubPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class BlubPageRoutingModule {}
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { BlubPageRoutingModule } from './blub-routing.module';
import { BlubPage } from './blub.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
BlubPageRoutingModule
],
declarations: [BlubPage]
})
export class BlubPageModule {}
<ion-header>
<ion-toolbar>
<ion-title>blub</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
</ion-content>
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { BlubPage } from './blub.page';
describe('BlubPage', () => {
let component: BlubPage;
let fixture: ComponentFixture<BlubPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ BlubPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(BlubPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-blub',
templateUrl: './blub.page.html',
styleUrls: ['./blub.page.scss'],
})
export class BlubPage implements OnInit {
constructor() { }
ngOnInit() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment