45621: finished filter facets for search sidebar

This commit is contained in:
Lotte Hofstede
2017-11-13 13:52:21 +01:00
parent be6f5ea9b5
commit 202b045009
18 changed files with 182 additions and 98 deletions

View File

@@ -1,4 +1,4 @@
import { Injectable, OnDestroy } from '@angular/core';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { ActivatedRoute, convertToParamMap, Params, } from '@angular/router';
import { isNotEmpty } from './empty.util';
@@ -9,6 +9,14 @@ export class RouteService {
constructor(private route: ActivatedRoute) {
}
getQueryParameterValues(paramName: string): Observable<string[]> {
return this.route.queryParamMap.map((map) => map.getAll(paramName));
}
getQueryParameterValue(paramName: string): Observable<string> {
return this.route.queryParamMap.map((map) => map.get(paramName));
}
hasQueryParam(paramName: string): Observable<boolean> {
return this.route.queryParamMap.map((map) => {return map.has(paramName);});
}