refactor: Clients Module
- refactors clients-routing.module.ts for dynamic breadcrumbs. - refactors clients.service.ts to use HttpClient - adds resolver to load client data - removes partially implemented components fixes: #409
This commit is contained in:
committed by
Abhay Chawla
parent
bab75357b4
commit
963ec68527
@@ -0,0 +1,30 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { ClientsService } from '../clients.service';
|
||||
|
||||
/**
|
||||
* Clients data resolver.
|
||||
*/
|
||||
@Injectable()
|
||||
export class ClientsResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {ClientsService} ClientsService Clients service.
|
||||
*/
|
||||
constructor(private clientsService: ClientsService) { }
|
||||
|
||||
/**
|
||||
* Returns the Clients data.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(): Observable<any> {
|
||||
return this.clientsService.getClients();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user