-
Notifications
You must be signed in to change notification settings - Fork 0
task#13 add routing file
bacn edited this page Sep 16, 2020
·
1 revision
This chapter can be skipped if the project has been created with a routing.
- Add
app-routing.module.tsin folder ./src/app - Import RouterModule and Routes from @angular/router
- Export an empty routes array
- Export your router created with
RouterModule.forRoot() - Export class
AppRoutingModule { }
The result is the same as in the last task.
Add the file app-routing.module.ts in the folder ./src/app and add the code import { Routes, RouterModule } from '@angular/router';
Define a routes array:
export const routes: Routes = [];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }