ing
This commit is contained in:
parent
ac267b8437
commit
948999efae
|
@ -2,11 +2,12 @@ import { NgModule } from '@angular/core';
|
|||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: 'auth', loadChildren: './pages/auth/auth.module#AuthModule' }
|
||||
{ path: '', loadChildren: './pages/pages.module#PagesModule' },
|
||||
{ path: 'auth', loadChildren: './pages/auth/auth.module#AuthModule' },
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forRoot(routes)],
|
||||
imports: [RouterModule.forRoot(routes, {useHash: true})],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AppRoutingModule { }
|
||||
|
|
21
src/app/pages/auth/auth-routing.module.ts
Normal file
21
src/app/pages/auth/auth-routing.module.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { AuthComponent } from './auth.component';
|
||||
import { SigninComponent } from './signin/signin.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: AuthComponent,
|
||||
children: [
|
||||
{ path: '', redirectTo: 'signin' },
|
||||
{ path: 'signin', component: SigninComponent },
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AuthRoutingModule { }
|
|
@ -1,7 +1,7 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'of-signin',
|
||||
selector: 'of-auth-signin',
|
||||
templateUrl: './signin.component.html',
|
||||
styleUrls: ['./signin.component.scss']
|
||||
})
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { SigninComponent } from 'app/packages/member/signin/signin.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule
|
||||
],
|
||||
declarations: [ SigninComponent ]
|
||||
})
|
||||
export class SigninModule { }
|
16
src/app/pages/home/home-routing.module.ts
Normal file
16
src/app/pages/home/home-routing.module.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { HomeComponent } from './home.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: HomeComponent,
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class HomeRoutingModule { }
|
3
src/app/pages/home/home.component.html
Normal file
3
src/app/pages/home/home.component.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
<p>
|
||||
home works!
|
||||
</p>
|
0
src/app/pages/home/home.component.scss
Normal file
0
src/app/pages/home/home.component.scss
Normal file
25
src/app/pages/home/home.component.spec.ts
Normal file
25
src/app/pages/home/home.component.spec.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HomeComponent } from './home.component';
|
||||
|
||||
describe('HomeComponent', () => {
|
||||
let component: HomeComponent;
|
||||
let fixture: ComponentFixture<HomeComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ HomeComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(HomeComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
15
src/app/pages/home/home.component.ts
Normal file
15
src/app/pages/home/home.component.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'of-home',
|
||||
templateUrl: './home.component.html',
|
||||
styleUrls: ['./home.component.scss']
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
13
src/app/pages/home/home.module.ts
Normal file
13
src/app/pages/home/home.module.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { HomeComponent } from './home.component';
|
||||
import { HomeRoutingModule } from './home-routing.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
HomeRoutingModule,
|
||||
],
|
||||
declarations: [HomeComponent]
|
||||
})
|
||||
export class HomeModule { }
|
20
src/app/pages/pages-routing.module.ts
Normal file
20
src/app/pages/pages-routing.module.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { PagesComponent } from './pages.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: PagesComponent,
|
||||
children: [
|
||||
{ path: '', redirectTo: 'home' },
|
||||
{ path: 'home', loadChildren: './home/home.module#HomeModule' },
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class PagesRoutingModule { }
|
4
src/app/pages/pages.component.html
Normal file
4
src/app/pages/pages.component.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
<div>header</div>
|
||||
<div>sidebar</div>
|
||||
<router-outlet></router-outlet>
|
||||
<div>footer</div>
|
0
src/app/pages/pages.component.scss
Normal file
0
src/app/pages/pages.component.scss
Normal file
25
src/app/pages/pages.component.spec.ts
Normal file
25
src/app/pages/pages.component.spec.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PagesComponent } from './pages.component';
|
||||
|
||||
describe('PagesComponent', () => {
|
||||
let component: PagesComponent;
|
||||
let fixture: ComponentFixture<PagesComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ PagesComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(PagesComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
15
src/app/pages/pages.component.ts
Normal file
15
src/app/pages/pages.component.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'of-pages',
|
||||
templateUrl: './pages.component.html',
|
||||
styleUrls: ['./pages.component.scss']
|
||||
})
|
||||
export class PagesComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
15
src/app/pages/pages.module.ts
Normal file
15
src/app/pages/pages.module.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { PagesComponent } from './pages.component';
|
||||
import { PagesRoutingModule } from './pages-routing.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
PagesRoutingModule,
|
||||
],
|
||||
declarations: [
|
||||
PagesComponent
|
||||
]
|
||||
})
|
||||
export class PagesModule { }
|
Loading…
Reference in New Issue
Block a user