Skip to content
Snippets Groups Projects
app-routing.module.ts 558 B
Newer Older
  • Learn to ignore specific revisions
  • wwwazz's avatar
    wwwazz committed
    import { NgModule } from '@angular/core';
    import { RouterModule, Routes } from '@angular/router';
    
    wwwazz's avatar
    wwwazz committed
    import { UserListComponent } from './user-list/user-list.component';
    
    wwwazz's avatar
    wwwazz committed
    import { UserDetailComponent } from './user-detail/user-detail.component';
    
    wwwazz's avatar
    wwwazz committed
    
    
    wwwazz's avatar
    wwwazz committed
    const routes: Routes = [
      {
    
    wwwazz's avatar
    wwwazz committed
        path: "",
    
    wwwazz's avatar
    wwwazz committed
        component: UserListComponent
      },
    
    wwwazz's avatar
    wwwazz committed
      { path: 'list', redirectTo: "", pathMatch: "full" },
    
      { path: "user/:id", component: UserDetailComponent }
    
    wwwazz's avatar
    wwwazz committed
    
    ];
    
    wwwazz's avatar
    wwwazz committed
    
    @NgModule({
      imports: [RouterModule.forRoot(routes)],
      exports: [RouterModule]
    })
    export class AppRoutingModule { }