modif app-routing-module
This commit is contained in:
parent
01b68c0899
commit
30f70296ba
@ -11,7 +11,8 @@ import { AdminPageComponent } from './pages/admin-page/admin-page.component';
|
|||||||
import { AuthGuard } from './services/auth.guard';
|
import { AuthGuard } from './services/auth.guard';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{ path: '', redirectTo: 'home', pathMatch: 'full' },
|
{ path: '', redirectTo: 'signin', pathMatch: 'full' },
|
||||||
|
{path: 'signin', component: SigninComponent},
|
||||||
{ path: 'home', component: HomePageComponent },
|
{ path: 'home', component: HomePageComponent },
|
||||||
{ path: 'categories', component: ListCategoriesComponent },
|
{ path: 'categories', component: ListCategoriesComponent },
|
||||||
{ path: 'favoris', component: FavorisUserComponent },
|
{ path: 'favoris', component: FavorisUserComponent },
|
||||||
@ -19,8 +20,7 @@ const routes: Routes = [
|
|||||||
{ path: 'Deconnexion', redirectTo: 'home'},
|
{ path: 'Deconnexion', redirectTo: 'home'},
|
||||||
{path: 'restaurants', canActivate: [AuthGuard], component: RestoPageComponent},
|
{path: 'restaurants', canActivate: [AuthGuard], component: RestoPageComponent},
|
||||||
{path: 'page-not-found',component: PageNotFoundComponent},
|
{path: 'page-not-found',component: PageNotFoundComponent},
|
||||||
{path: 'signin', component: SigninComponent},
|
{path: 'admin', component: AdminPageComponent},
|
||||||
{path: 'admin', component: AdminPageComponent},
|
|
||||||
{path: '**', redirectTo: 'page-not-found' }
|
{path: '**', redirectTo: 'page-not-found' }
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ export class AppComponent {
|
|||||||
//console.log(e);
|
//console.log(e);
|
||||||
if(e instanceof NavigationEnd){
|
if(e instanceof NavigationEnd){
|
||||||
console.log(e.url)
|
console.log(e.url)
|
||||||
if (e.url == "/signin") {
|
if (e.url == "/") {
|
||||||
this.dontShow = false;
|
this.dontShow = false;
|
||||||
} else {
|
} else {
|
||||||
this.dontShow = true;
|
this.dontShow = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user