import { Component } from '@angular/core' ; import { Router } from '@angular/router' ; import { Observable } from 'rxjs' ; import { DataService , AuthenticationService } from '../shared' ; @ Component ( { selector : 'app-dashboard' , templateUrl : './dashboard.component.html' } ) export class DashboardComponent { public users$ : Observable < any > ; public data$ : Observable < any > ; constructor ( private router , private dataService , private authService ) { } public loadData ( ) { this . users$ = this . dataService . getUsers ( ) ; this . data$ = this . dataService . getData ( ) ; } public logout ( ) { this . authService . logout ( ) ; this . router . navigateByUrl ( '/' ) ; } }