From ce33a4212d3dc010e19070ea77b9dd991393bf0b Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sat, 26 Jan 2019 13:43:39 +0000 Subject: [PATCH] Got the search properly working !wip --- .../src/app/my-nav/nav-search.component.html | 17 ++++++++--------- .../src/app/my-nav/nav-search.component.scss | 2 +- .../src/app/my-nav/nav-search.component.ts | 12 ++++++++---- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/my-nav/nav-search.component.html b/src/Ombi/ClientApp/src/app/my-nav/nav-search.component.html index 43028b94a..a308dbdfd 100644 --- a/src/Ombi/ClientApp/src/app/my-nav/nav-search.component.html +++ b/src/Ombi/ClientApp/src/app/my-nav/nav-search.component.html @@ -1,15 +1,14 @@ - - - - - {{option.name}} + + + + + {{result.name}} - - {{option.title}} + + {{result.title}} - - \ No newline at end of file + \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/my-nav/nav-search.component.scss b/src/Ombi/ClientApp/src/app/my-nav/nav-search.component.scss index 7e650240c..ce71d59cb 100644 --- a/src/Ombi/ClientApp/src/app/my-nav/nav-search.component.scss +++ b/src/Ombi/ClientApp/src/app/my-nav/nav-search.component.scss @@ -1,5 +1,5 @@ .quater-width { - width: 25%; + width: 25em; } .autocomplete-img { diff --git a/src/Ombi/ClientApp/src/app/my-nav/nav-search.component.ts b/src/Ombi/ClientApp/src/app/my-nav/nav-search.component.ts index 61342e3c0..b48f02189 100644 --- a/src/Ombi/ClientApp/src/app/my-nav/nav-search.component.ts +++ b/src/Ombi/ClientApp/src/app/my-nav/nav-search.component.ts @@ -1,10 +1,10 @@ import { Component, Input } from '@angular/core'; -import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; -import { Observable, Subject } from 'rxjs'; -import { map, debounceTime, distinctUntilChanged } from 'rxjs/operators'; +import { Subject } from 'rxjs'; +import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { SearchV2Service } from '../services/searchV2.service'; import { IMultiSearchResult } from '../interfaces'; +import { MatAutocompleteSelectedEvent } from '@angular/material'; @Component({ selector: 'app-nav-search', @@ -16,7 +16,6 @@ export class NavSearchComponent { public searchChanged: Subject = new Subject(); public searchText: string; public searchResult: IMultiSearchResult[]; - public option: IMultiSearchResult; constructor(private searchService: SearchV2Service) { this.searchChanged.pipe( @@ -31,4 +30,9 @@ export class NavSearchComponent { public search(text: any) { this.searchChanged.next(text.target.value); } + + public selected(option: MatAutocompleteSelectedEvent) { + var selected = option.option.value as IMultiSearchResult; + + } }