aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/angular/app/search.component.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-05-27 16:23:10 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-05-27 16:23:10 +0200
commit41a2aee38cf812510010da09de9bae53590ec119 (patch)
tree79d55d6ae0ef6f66ccb88890cf1ef1946dc65fb4 /client/angular/app/search.component.ts
parent157cb9c9713e08ff70078660a32dd77ecb87eabc (diff)
downloadPeerTube-41a2aee38cf812510010da09de9bae53590ec119.tar.gz
PeerTube-41a2aee38cf812510010da09de9bae53590ec119.tar.zst
PeerTube-41a2aee38cf812510010da09de9bae53590ec119.zip
Follow the angular styleguide for the directories structure
Diffstat (limited to 'client/angular/app/search.component.ts')
-rw-r--r--client/angular/app/search.component.ts46
1 files changed, 0 insertions, 46 deletions
diff --git a/client/angular/app/search.component.ts b/client/angular/app/search.component.ts
deleted file mode 100644
index e21b91fce..000000000
--- a/client/angular/app/search.component.ts
+++ /dev/null
@@ -1,46 +0,0 @@
1import { Component, EventEmitter, Output } from '@angular/core';
2
3import { DROPDOWN_DIRECTIVES} from 'ng2-bootstrap/components/dropdown';
4
5import { Search, SearchField } from './search';
6
7@Component({
8 selector: 'my-search',
9 templateUrl: 'app/angular/app/search.component.html',
10 directives: [ DROPDOWN_DIRECTIVES ]
11})
12
13export class SearchComponent {
14 @Output() search: EventEmitter<Search> = new EventEmitter<Search>();
15
16 searchCriterias: Search = {
17 field: 'name',
18 value: ''
19 };
20 fieldChoices = {
21 name: 'Name',
22 author: 'Author',
23 podUrl: 'Pod Url',
24 magnetUri: 'Magnet Uri'
25 };
26
27 get choiceKeys() {
28 return Object.keys(this.fieldChoices);
29 }
30
31 getStringChoice(choiceKey: SearchField): string {
32 return this.fieldChoices[choiceKey];
33 }
34
35 choose($event:MouseEvent, choice: SearchField) {
36 $event.preventDefault();
37 $event.stopPropagation();
38
39 this.searchCriterias.field = choice;
40 }
41
42 doSearch(): void {
43 this.search.emit(this.searchCriterias);
44 }
45
46}