December 2017
Beginner
372 pages
10h 32m
English
The following is the code for the app-routing.module.ts file which was generated by Angular CLI:
import { NgModule } from '@angular/core';import { Routes, RouterModule } from '@angular/router';const routes: Routes = [ { path: '', children: [] }];@NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule]})export class AppRoutingModule { } As we can see, Angular CLI created an App routing module and added route paths. Now, the CLI does not know which routes you want to define, hence the path is blank. But the CLI has done all the basic work for you to set up the routing and plug it into the app module, as can be seen in the following code from app.module.ts:
import { BrowserModule } from '@angular/platform-browser'; ...Read now
Unlock full access