To learn more about routing in Angular 2, and for better understanding of the coming steps, you can visit the following URL:.
Our simple website has the following pages: Home, Features, Pricing, and About. So we have to create four new components (views). For the home page, create a file call in
home.component.ts in the
app folder. The
home.component.t
s file should contain the following TypeScript code:
import { Component } from '@angular/core'; @Component({ selector: 'home', template: '<h3>Home</h3>' }) export class HomeComponent { }
Repeat the preceding steps for each page, and create the
features,
component.ts,
pricing.component.ts, and
about.component.ts files ...
No credit card required