May 2018
Intermediate to advanced
512 pages
11h 3m
English
With the Router-first approach, we will want to enable routing early on in our application:
Ensure that @angular/cli is not installed globally, or you may run into errors:
$ npx @angular/cli new lemon-mart --routing
src/app/app-routing.modules.ts
import { NgModule } from '@angular/core';import { Routes, RouterModule } from '@angular/router';const routes: Routes = [];@NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule]})export class AppRoutingModule { }
We will be defining routes inside the routes array. Note that routes array is passed in ...
Read now
Unlock full access