-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsearch.component.ts
More file actions
52 lines (44 loc) · 1.22 KB
/
search.component.ts
File metadata and controls
52 lines (44 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import * as angular from 'angular';
export let SearchComponent = {
selector: 'search',
template: `
<form class="navbar-form navbar-left">
<div class="form-group">
<input type="text"
class="form-control"
id="name"
ng-model="$ctrl.contacts.search"
ng-model-options="{ debounce: 300 }"
placeholder="Search name..."
ng-change="$ctrl.contacts.doSearch()"
/>
</div>
<div class="form-group">
<select class="form-control"
ng-model="$ctrl.contacts.sorting"
ng-change="$ctrl.contacts.doSearch()">
<option value="name">Name</option>
<option value="email">Email</option>
</select>
</div>
<div class="form-group">
<select class="form-control"
ng-model="$ctrl.contacts.ordering"
ng-change="$ctrl.contacts.doSearch()">
<option value="ASC">ASC</option>
<option value="DESC">DESC</option>
</select>
</div>
</form>
`,
bindings: {},
controller: class SearchController {
private contacts = null;
constructor(ContactService) {
this.contacts = ContactService;
}
}
};
angular
.module('codecraft')
.component(SearchComponent.selector, SearchComponent);