feat: add groups view page (notes-tab) (#789)

Fixes: #778
This commit is contained in:
Karan Takalkar
2020-05-20 16:17:55 +05:30
committed by GitHub
parent 2e89538432
commit a5711131c7
9 changed files with 304 additions and 2 deletions
@@ -0,0 +1,32 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { GroupsService } from '../groups.service';
/**
* Group Notes data resolver.
*/
@Injectable()
export class GroupNotesResolver implements Resolve<Object> {
/**
* @param {GroupsService} GroupsService Groups service.
*/
constructor(private groupsService: GroupsService) { }
/**
* Returns the Group's Notes data.
* @param {ActivatedRouteSnapshot} route Route Snapshot.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const groupId = route.parent.paramMap.get('groupId');
return this.groupsService.getGroupNotes(groupId);
}
}