(label: string, params: { [key: string]: string|undefined})
| 80 | } |
| 81 | |
| 82 | setSearch(label: string, params: { [key: string]: string|undefined}) { |
| 83 | const search = Object.keys(params).reduce((acc, key) => { |
| 84 | const value = params[key]; |
| 85 | return (value === undefined) ? acc : |
| 86 | acc += (acc ? '&' : '?') + `${encodeURIComponent(key)}=${encodeURIComponent(value)}`; |
| 87 | }, ''); |
| 88 | |
| 89 | this.platformLocation.replaceState({}, label, this.platformLocation.pathname + search); |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * Handle user's anchor click |
no test coverage detected