feat: add center view (notes tab) (#787)

Fixes: #785
This commit is contained in:
Muskan Khedia
2020-05-20 17:50:06 +05:30
committed by GitHub
parent a5711131c7
commit 67b766e61f
9 changed files with 253 additions and 3 deletions
@@ -0,0 +1,31 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { CentersService } from '../centers.service';
/**
* Centers notes data resolver.
*/
@Injectable()
export class CenterNotesResolver implements Resolve<Object> {
/**
* @param {CentersService} CentersService Centers service.
*/
constructor(private centersService: CentersService) { }
/**
* Returns the Centers Notes Data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const centerId = route.parent.paramMap.get('centerId');
return this.centersService.getCenterNotes(centerId);
}
}