From 575daccf9b3f39faf9d16df9b9da9bbfd8d29156 Mon Sep 17 00:00:00 2001 From: Abner Oliveira Date: Tue, 14 Jun 2016 18:37:59 -0300 Subject: [PATCH] changed search.component and the search-form.component to fill the query field with the query value in the current query param. changed the search.component to have a search text box to show then current query and allow the user query for new terms. --- src/app/search/search-form/search-form.component.ts | 11 ++++++++++- src/app/search/search-form/search-form.html | 2 +- src/app/search/search.component.ts | 13 ++++++++++--- src/app/search/search.html | 6 ++++-- src/app/search/search.scss | 22 ++++++++++++++++++++-- src/languages/en.json | 4 +++- src/languages/pt.json | 4 +++- 7 files changed, 51 insertions(+), 11 deletions(-) diff --git a/src/app/search/search-form/search-form.component.ts b/src/app/search/search-form/search-form.component.ts index c8978ed..5bffbba 100644 --- a/src/app/search/search-form/search-form.component.ts +++ b/src/app/search/search-form/search-form.component.ts @@ -9,9 +9,18 @@ export class SearchFormComponent { query: string; - constructor(private $state: ng.ui.IStateService) { } + constructor(private $state: ng.ui.IStateService) { + } + + ngOnInit() { + this.query = this.$state.params['query']; + } search() { this.$state.go('main.environment.search', { query: this.query }); } + + isSearchPage() { + return "main.environment.search" === this.$state.current.name; + } } diff --git a/src/app/search/search-form/search-form.html b/src/app/search/search-form/search-form.html index 3c59af3..e1878b5 100644 --- a/src/app/search/search-form/search-form.html +++ b/src/app/search/search-form/search-form.html @@ -1,4 +1,4 @@ -