* Refractor components. * Add resolvers. * Add relative router links. * Replace mat-icons by font-awesome icons. * Add comments. Fixes: #298
31 lines
664 B
TypeScript
31 lines
664 B
TypeScript
/** Angular Imports */
|
|
import { Injectable } from '@angular/core';
|
|
import { Resolve } from '@angular/router';
|
|
|
|
/** rxjs Imports */
|
|
import { Observable } from 'rxjs';
|
|
|
|
/** Custom Services */
|
|
import { AccountingService } from '../accounting.service';
|
|
|
|
/**
|
|
* Offices data resolver.
|
|
*/
|
|
@Injectable()
|
|
export class OfficesResolver implements Resolve<Object> {
|
|
|
|
/**
|
|
* @param {AccountingService} accountingService Accounting service.
|
|
*/
|
|
constructor(private accountingService: AccountingService) {}
|
|
|
|
/**
|
|
* Returns the offices data.
|
|
* @returns {Observable<any>}
|
|
*/
|
|
resolve(): Observable<any> {
|
|
return this.accountingService.getOffices();
|
|
}
|
|
|
|
}
|