Creating A Routing Module

Angular Routing Module

Router Module Boilerplate Explained

Create an app-routing.module.ts file, within your src/app directory

app-routing.module.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

Line 1 & 2: We need to import the NgModule, Routes and RouterModule classes from angular.

Troubleshooting

Any errors here will be a typo for file path double check that first.

Last updated