Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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