AngularJS Routing

AngularJS Navigation Tutorial Angular provides a separate module, RouterModule to set up the navigation in the Angular application. Let us learn the how to do the routing in Angular application in this chapter. It does moves from one view (list of expenses) to another view (expense details). Let us create a new application C:\> ng new routing-app Angular CLI generate a new module, AppRoutingModuele for routing purpose. The code looks as follows − import { NgModule } from '@angular/core' ; import { RouterModule, Routes } from '@angular/router' ; const routes: Routes = []; @ NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) export class AppRoutingModule { } above code, Imports RouterModule and Routes from @angular/router package. RouterModule allows configuring and execute routing in the application. Routes is the type used to setup the navigation rules. Routes is the local variable (of type Route...