feat: add create view survey page (#1247)

Fixes: #580
This commit is contained in:
Shubhankar Bhadra
2020-10-16 21:09:57 +05:30
committed by GitHub
parent e3b7f5799d
commit 2b5341aa2c
10 changed files with 278 additions and 2 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 { SystemService } from '../system.service';
/**
* System data resolver.
*/
@Injectable()
export class SurveyResolver implements Resolve<Object> {
/**
* @param {SystemService} systemService System service.
*/
constructor(private systemService: SystemService) {}
/**
* Returns the Survey data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const surveyId = route.paramMap.get('id');
return this.systemService.getSurvey(surveyId);
}
}