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 @@ -