You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.9 KiB
46 lines
1.9 KiB
import { NgModule } from '@angular/core';
|
|
import { RouterModule, Routes } from '@angular/router';
|
|
import { CatalogComponent } from './component/catalog/catalog.component';
|
|
import { ProductComponent } from './component/product/product.component';
|
|
import { LoginComponent } from './auth/login/login.component';
|
|
import { AuthGuardService } from './auth/service/auth-guard.service';
|
|
import { SignUpComponent } from './auth/sign-up/sign-up.component';
|
|
import { AccountComponent } from './component/account/account.component';
|
|
import { HomeComponent } from './component/home/home.component';
|
|
import { NavbarComponent } from './component/navbar/navbar.component';
|
|
import { PagenotfoundComponent } from './component/pagenotfound/pagenotfound.component';
|
|
import { CartComponent } from './component/cart/cart.component';
|
|
import { OrderComponent } from './component/order/order.component';
|
|
|
|
const routes: Routes = [
|
|
{path: 'product/:pid', component: ProductComponent, canActivate: [AuthGuardService]},
|
|
{path: 'catalog/:cname', component: CatalogComponent, canActivate: [AuthGuardService]},
|
|
{path: 'catalog', component: CatalogComponent, canActivate: [AuthGuardService]},
|
|
{
|
|
path:'',redirectTo:'/login',pathMatch:'full'
|
|
},
|
|
{path:'login',component:LoginComponent},
|
|
{
|
|
path:'signup',component:SignUpComponent
|
|
},
|
|
{
|
|
path:'account',component:AccountComponent, canActivate: [AuthGuardService]
|
|
},
|
|
{
|
|
path:'home',component:HomeComponent, canActivate: [AuthGuardService]
|
|
},
|
|
{
|
|
path:'navbar',component:NavbarComponent, canActivate: [AuthGuardService]
|
|
},
|
|
{path: 'cart',component:CartComponent, canActivate: [AuthGuardService]},
|
|
{path:'order',component:OrderComponent, canActivate: [AuthGuardService]},
|
|
{
|
|
path:'**',component:PagenotfoundComponent
|
|
},
|
|
];
|
|
|
|
@NgModule({
|
|
imports: [RouterModule.forRoot(routes)],
|
|
exports: [RouterModule]
|
|
})
|
|
export class AppRoutingModule { }
|