Don't clear search box on search page when a new query is submitted

Users want to be able to see the current query
This commit is contained in:
Joseph Schorr 2017-05-03 15:35:24 -04:00
parent 19f67bfa1b
commit 17c4d4c84e
3 changed files with 4 additions and 4 deletions

View file

@ -10,6 +10,7 @@ import { Input, Component, Inject } from 'ng-metadata/core';
})
export class SearchBoxComponent {
@Input('<query') public enteredQuery: string = '';
@Input('@clearOnSearch') public clearOnSearch: string = 'true';
private isSearching: boolean = false;
private currentQuery: string = '';
@ -48,7 +49,7 @@ export class SearchBoxComponent {
private onEntered($event): void {
this.$timeout(() => {
$event['callback'](true); // Clear the value.
$event['callback'](this.clearOnSearch == 'true'); // Clear the value.
this.$location.url('/search');
this.$location.search('q', $event['value']);
}, 10);