-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
104 lines (97 loc) · 2.89 KB
/
index.html
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html lang="en" ng-app="group-filter">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Group Filter</title>
<link
rel="stylesheet"
href="node_modules/bootstrap/dist/css/bootstrap.css"
/>
</head>
<body ng-controller="filterController">
<div class="container">
<div class="row mt-2">
<div class="col-lg-12">
<h1>Utilizando filtros de pesquisa</h1>
<hr />
</div>
</div>
<div class="row">
<div class="col-lg-4 form-group" ng-repeat="filter in addedFilters">
<div class="input-group">
<input
type="text"
class="form-control"
placeholder="{{ filter.name }}: {{ filter.value }}"
readonly
/>
<div class="input-group-prepend">
<span
class="input-group-text btn btn-danger"
ng-click="removeFilter(filter)"
>
X
</span>
</div>
</div>
</div>
</div>
<form name="formFilter" ng-submit="addFilter()">
<div class="row">
<div class="col-lg-4 mb-3">
<select
class="form-control"
ng-model="selectedFilter"
ng-options="filter as filter.name for filter in filters"
ng-change="changeFilter()"
required
>
<option value="">Selecione um filtro</option>
</select>
</div>
<div class="col-lg-4 mb-3">
<select
class="form-control"
ng-model="selectedFilter.value"
ng-if="selectedFilter"
ng-options="item for item in listItems"
required
>
<option value="">Selecione uma opção</option>
</select>
</div>
<div class="col-lg-4 mb-3">
<button class="btn btn-dark form-control">
Filtrar
</button>
</div>
</div>
</form>
<div class="row">
<div class="col-lg-12">
<table class="table table-striped">
<thead>
<tr>
<th>Categoria</th>
<th>Marca</th>
<th>Modelo</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="car in listCars">
<td>{{ car.category }}</td>
<td>{{ car.brand }}</td>
<td>{{ car.model }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script src="node_modules/angular/angular.js"></script>
<script src="app.js"></script>
<script src="filterController.js"></script>
</body>
</html>