Only page not found when no routing is matched on production environment
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit
This commit is contained in:
parent
7ba35052ec
commit
af9acebaff
@ -7,6 +7,7 @@ import {NavBarGuard} from './services/nav-bar-guard.service';
|
||||
import {FullScreenGuard} from './services/full-screen-guard.service';
|
||||
import {SessionClearedComponent} from './components/session-cleared/session-cleared.component';
|
||||
import {NotFoundComponent} from './components/not-found/not-found.component';
|
||||
import { ProductionGuard } from './services/production-guard.service';
|
||||
|
||||
|
||||
const routes = [
|
||||
@ -21,7 +22,7 @@ const routes = [
|
||||
},
|
||||
{
|
||||
path: '**', component: NotFoundComponent,
|
||||
canActivate: [NavBarGuard]
|
||||
canActivate: [NavBarGuard, ProductionGuard]
|
||||
}
|
||||
];
|
||||
|
||||
|
11
projects/common/src/fm/services/production-guard.service.ts
Normal file
11
projects/common/src/fm/services/production-guard.service.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ProductionGuard {
|
||||
canActivate(): boolean {
|
||||
return environment.production;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user