test
This commit is contained in:
parent
c331f7cfaa
commit
56768d5f81
|
@ -5,7 +5,7 @@ import { AuthGuard } from './commons/guard/auth.guard';
|
|||
const routes: Routes = [
|
||||
{ path: '', loadChildren: './pages/pages.module#PagesModule', canActivate: [AuthGuard] },
|
||||
{ path: 'auth', loadChildren: './pages/auth/auth-page.module#AuthPageModule' },
|
||||
// { path: '**', component: NotFoundPageComponent },
|
||||
{ path: '**', loadChildren: './pages/error/error-page.module#ErrorPageModule' },
|
||||
// { path: 'errors', loadChildren: './pages/errors/errors-page.module#ErrorsPageModule' },
|
||||
];
|
||||
|
||||
|
|
16
src/app/pages/error/error-page-routing.module.ts
Normal file
16
src/app/pages/error/error-page-routing.module.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { ErrorPageComponent } from './error-page.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ErrorPageComponent,
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class ErrorPageRoutingModule { }
|
1
src/app/pages/error/error-page.component.html
Normal file
1
src/app/pages/error/error-page.component.html
Normal file
|
@ -0,0 +1 @@
|
|||
Error Page
|
18
src/app/pages/error/error-page.component.ts
Normal file
18
src/app/pages/error/error-page.component.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'of-pages-error',
|
||||
templateUrl: './error-page.component.html',
|
||||
})
|
||||
|
||||
export class ErrorPageComponent implements OnInit {
|
||||
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
18
src/app/pages/error/error-page.module.ts
Normal file
18
src/app/pages/error/error-page.module.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
import { ErrorPageComponent } from './error-page.component';
|
||||
import { ErrorPageRoutingModule } from './error-page-routing.module';
|
||||
import { PrimeNGModules } from 'packages/commons/prime-ng/prime-ng.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
ErrorPageRoutingModule,
|
||||
PrimeNGModules,
|
||||
],
|
||||
entryComponents: [
|
||||
],
|
||||
declarations: [ErrorPageComponent]
|
||||
})
|
||||
export class ErrorPageModule { }
|
|
@ -1,4 +1,4 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { Component, OnInit, OnDestroy } from '@angular/core';
|
||||
import { Router, NavigationEnd } from '@angular/router';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
|
||||
|
@ -6,19 +6,26 @@ import { Subscription } from 'rxjs/Subscription';
|
|||
selector: 'of-pages-probe',
|
||||
templateUrl: './probe-page.component.html',
|
||||
})
|
||||
export class ProbePageComponent {
|
||||
export class ProbePageComponent implements OnInit, OnDestroy {
|
||||
|
||||
private tabs = undefined;
|
||||
private routerSubscription: Subscription;
|
||||
private routerSubscription$: Subscription;
|
||||
|
||||
constructor(private router: Router) {
|
||||
router.events.subscribe((event) => {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.routerSubscription$ = this.router.events.subscribe((event) => {
|
||||
if (event instanceof NavigationEnd) {
|
||||
this.generateTabMenu(event);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.routerSubscription$.unsubscribe();
|
||||
}
|
||||
|
||||
generateTabMenu(event: NavigationEnd) {
|
||||
const parsedUrl = event.url.split('probe/')[1].split('/')[0];
|
||||
switch (parsedUrl) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user