1import { Component, OnInit } from '@angular/core';
2
3@Component({
4 selector: 'app-example',
5 templateUrl: './example.component.html',
6 styleUrls: ['./example.component.css']
7})
8export class ExampleComponent implements OnInit {
9 constructor() { }
10
11 ngOnInit() { }
12}
1<!-- app.component.html -->
2
3<ul>
4 <li routerLink="/A">Go to A!</li>
5 <li routerLink="/B">Go to B!</li>
6</ul>
7<router-outlet></router-outlet>