Skip to content

Instantly share code, notes, and snippets.

@ssukhpinder
Created July 25, 2020 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssukhpinder/4879536fb258a5003c1b22f55fb0a6b2 to your computer and use it in GitHub Desktop.
Save ssukhpinder/4879536fb258a5003c1b22f55fb0a6b2 to your computer and use it in GitHub Desktop.
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { AuthenticationGuard } from './authentication.guard';
const routes: Routes = [
{ path: '*', pathMatch: 'full', redirectTo: 'home' },
{ path: 'home', component: HomeComponent, canActivate: [AuthenticationGuard] }
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment