import { Routes , RouterModule } from '@angular/router' ; import { LoginComponent } from './login/index' ; import { HomeComponent } from './home/index' ; import { AuthGuard } from './_guards/index' ; const appRoutes = [ { path : 'login' , component : LoginComponent } , { path : '' , component : HomeComponent , canActivate : [ AuthGuard ] } , { path : '**' , redirectTo : '' } ] ; export const routing = RouterModule . forRoot ( appRoutes ) ;