You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
999 B
37 lines
999 B
4 years ago
|
import { Injectable } from '@angular/core';
|
||
|
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
||
|
import { Observable } from 'rxjs';
|
||
|
import { DashboardService } from 'app/modules/admin/dashboard/dashboard.service';
|
||
|
|
||
|
@Injectable({
|
||
|
providedIn: 'root'
|
||
|
})
|
||
|
export class DashboardResolver implements Resolve<any>
|
||
|
{
|
||
|
/**
|
||
|
* Constructor
|
||
|
*
|
||
|
* @param {FinanceService} _dashboardService
|
||
|
*/
|
||
|
constructor(
|
||
|
private _dashboardService: DashboardService
|
||
|
)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
// -----------------------------------------------------------------------------------------------------
|
||
|
// @ Public methods
|
||
|
// -----------------------------------------------------------------------------------------------------
|
||
|
|
||
|
/**
|
||
|
* Resolver
|
||
|
*
|
||
|
* @param route
|
||
|
* @param state
|
||
|
*/
|
||
|
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<any>
|
||
|
{
|
||
|
return this._dashboardService.getData();
|
||
|
}
|
||
|
}
|