From 471bc22f19767c1cb1e7ba7ad0ddf0ff5f0e88f4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 23 May 2016 09:30:18 +0200 Subject: Add search with field choose support in client --- client/angular/videos/components/list/videos-list.component.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'client/angular/videos/components') diff --git a/client/angular/videos/components/list/videos-list.component.ts b/client/angular/videos/components/list/videos-list.component.ts index 341afdaa6..a17b06cd9 100644 --- a/client/angular/videos/components/list/videos-list.component.ts +++ b/client/angular/videos/components/list/videos-list.component.ts @@ -9,6 +9,7 @@ import { User } from '../../../users/models/user'; import { VideosService } from '../../videos.service'; import { Video } from '../../video'; import { VideoMiniatureComponent } from './video-miniature.component'; +import { Search, SearchField } from '../../../app/search'; @Component({ selector: 'my-videos-list', @@ -26,14 +27,17 @@ export class VideosListComponent implements OnInit { total: 0 } - private search: string; + private search: Search; constructor( private _authService: AuthService, private _videosService: VideosService, private _routeParams: RouteParams ) { - this.search = this._routeParams.get('search'); + this.search = { + value: this._routeParams.get('search'), + field: this._routeParams.get('field') + } } ngOnInit() { @@ -47,7 +51,7 @@ export class VideosListComponent implements OnInit { getVideos() { let observable = null; - if (this.search !== null) { + if (this.search.value !== null) { observable = this._videosService.searchVideos(this.search, this.pagination); } else { observable = this._videosService.getVideos(this.pagination); -- cgit v1.2.3