Skip to content

Commit cfad75a

Browse files
committed
test(home): updated module to enable testing non-standalone projects
1 parent 53a8f2f commit cfad75a

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

src/app/home/home-routing.module.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { NgModule } from '@angular/core';
2+
import { RouterModule, Routes } from '@angular/router';
3+
import { HomePage } from './home.page';
4+
5+
const routes: Routes = [
6+
{
7+
path: '',
8+
component: HomePage,
9+
}
10+
];
11+
12+
@NgModule({
13+
imports: [RouterModule.forChild(routes)],
14+
exports: [RouterModule]
15+
})
16+
export class HomePageRoutingModule {}

src/app/home/home.module.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
23
import { IonicModule } from '@ionic/angular';
3-
import { IonicHeaderParallaxModule } from 'ionic-header-parallax'
4+
import { FormsModule } from '@angular/forms';
5+
import { RouterModule } from '@angular/router';
46
import { HomePage } from './home.page';
7+
import { IonicHeaderParallaxModule } from 'ionic-header-parallax';
8+
9+
// This module is kept to test backward compatibility with Angular projects
10+
// that do not use standalone components.
511

612
@NgModule({
713
declarations: [HomePage],
8-
imports: [IonicHeaderParallaxModule, IonicModule],
9-
exports: [HomePage],
14+
imports: [
15+
CommonModule,
16+
FormsModule,
17+
IonicModule,
18+
RouterModule.forChild([
19+
{
20+
path: '',
21+
component: HomePage
22+
}
23+
]),
24+
IonicHeaderParallaxModule
25+
]
1026
})
11-
export class HomePageModule {
12-
constructor() {}
13-
}
27+
export class HomePageModule {}

0 commit comments

Comments
 (0)