Skip to content

Commit

Permalink
feat(page): add home page
Browse files Browse the repository at this point in the history
  • Loading branch information
bravemaster619 committed Apr 25, 2020
1 parent 5ebf624 commit 540a943
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { NgModule } from '@angular/core'
import { PreloadAllModules, RouterModule, Routes } from '@angular/router'
import { NgModule } from "@angular/core";
import { PreloadAllModules, RouterModule, Routes } from "@angular/router";

const routes: Routes = [
{
path: '',
path: "",
loadChildren: () =>
import('./tabs/tabs.module').then((m) => m.TabsPageModule),
},
]
import("./pages/home/home.module").then((m) => m.HomePageModule)
}
];
@NgModule({
imports: [
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }),
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
],
exports: [RouterModule],
exports: [RouterModule]
})
export class AppRoutingModule {}
17 changes: 17 additions & 0 deletions src/app/pages/home/home-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";

import { HomePage } from "./home.page";

const routes: Routes = [
{
path: "",
component: HomePage
}
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class HomePageRoutingModule {}
22 changes: 22 additions & 0 deletions src/app/pages/home/home.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { FormsModule } from "@angular/forms";

import { IonicModule } from "@ionic/angular";

import { HomePageRoutingModule } from "./home-routing.module";

import { HomePage } from "./home.page";
import { TranslateModule } from "@ngx-translate/core";

@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
HomePageRoutingModule,
TranslateModule.forChild()
],
declarations: [HomePage]
})
export class HomePageModule {}
20 changes: 20 additions & 0 deletions src/app/pages/home/home.page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<ion-tabs>

<ion-tab-bar slot="bottom">
<ion-tab-button tab="tab1">
<ion-icon name="triangle"></ion-icon>
<ion-label translate="Home"></ion-label>
</ion-tab-button>

<ion-tab-button tab="tab2">
<ion-icon name="ellipse"></ion-icon>
<ion-label>Tab 2</ion-label>
</ion-tab-button>

<ion-tab-button tab="tab3">
<ion-icon name="square"></ion-icon>
<ion-label>Tab 3</ion-label>
</ion-tab-button>
</ion-tab-bar>

</ion-tabs>
Empty file.
32 changes: 32 additions & 0 deletions src/app/pages/home/home.page.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { async, ComponentFixture, TestBed } from "@angular/core/testing";
import { IonicModule } from "@ionic/angular";

import { HomePage } from "./home.page";
import { TranslateModule } from '@ngx-translate/core';
import { RouterModule } from '@angular/router';
import { HttpClientModule } from '@angular/common/http';

describe("HomePage", () => {
let component: HomePage;
let fixture: ComponentFixture<HomePage>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [HomePage],
imports: [
HttpClientModule,
IonicModule.forRoot(),
TranslateModule.forRoot(),
RouterModule.forRoot([])
]
}).compileComponents();

fixture = TestBed.createComponent(HomePage);
component = fixture.componentInstance;
fixture.detectChanges();
}));

it("should create", () => {
expect(component).toBeTruthy();
});
});
12 changes: 12 additions & 0 deletions src/app/pages/home/home.page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Component, OnInit } from "@angular/core";

@Component({
selector: "app-home",
templateUrl: "./home.page.html",
styleUrls: ["./home.page.scss"]
})
export class HomePage implements OnInit {
constructor() {}

ngOnInit() {}
}

0 comments on commit 540a943

Please sign in to comment.