October 2017
Intermediate to advanced
280 pages
6h 50m
English
Let's take a brief look at the new syntax provided by the Angular router to define routes in our applications:
import {Component, NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {RouterModule, Routes} from '@angular/router'; import {HomeComponent} from './home/home.component'; import {AboutComponent} from './about/about.component'; import {AppComponent} from './app.component'; const routes: Routes = [ { path: 'home', component: HomeComponent }, { path: 'about', component: AboutComponent } ]; @NgModule({ imports: [BrowserModule, RouterModule.forRoot(routes)], declarations: [AppComponent, HomeComponent, AboutComponent], bootstrap: [AppComponent] }) export class ...Read now
Unlock full access