From GandalfLife, 11 Months ago, written in JavaScript.
Embed
  1. import { NgModule } from '@angular/core';
  2. import { Routes, RouterModule } from '@angular/router';
  3.  
  4. import { HomeComponent } from './components/home/home.component';
  5.  
  6.  
  7. const routes: Routes = [
  8.         {
  9.         path: 'home', component: HomeComponent
  10.     },
  11.     {
  12.         path: '', redirectTo: 'home', pathMatch: 'full'
  13.     }
  14. ];
  15.  
  16. @NgModule({
  17.   imports: [RouterModule.forRoot(routes)],
  18.   exports: [RouterModule]
  19. })
  20. export class AppRoutingModule { }
  21.