home.component.html
<h4>Welcome to Server Manager 4.0</h4> <p>Manage your Servers and Users.</p> <button class="btn btn-primary" (click)="onLoadServers()">Load Servers</button>
home.component.ts
import {Component, OnInit} from '@angular/core';
import {Router} from '@angular/router';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
constructor(private router: Router) {
}
ngOnInit() {
}
onLoadServers() {
// do some complex calculation
this.router.navigate(['/servers']);
}
}