/
Product.html
71 lines (63 loc) · 1.9 KB
/
Product.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
<!DOCTYPE html>
<html ng-app="com.model">
<head>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
</head>
<body ng-controller="productController">
<div class="container">
<h3>Product</h3>
<table class="table table-striped">
<thead><tr>
<th>Edit</th>
<th>id</th>
<th>client_id</th>
<th>label</th>
</tr></thead>
<tbody><tr ng-repeat="product in products">
<td>
<button class="btn" ng-click="editProduct($index)">
<span class="glyphicon glyphicon-pencil"></span> Edit
</button>
</td>
<td>{{ product.id }}</td>
<td>{{ product.client_id }}</td>
<td>{{ product.label }}</td>
</tr></tbody>
</table>
<hr>
<button class="btn btn-success" ng-click="editProduct('new')">
<span class="glyphicon glyphicon-user"></span> Create New User
</button>
<hr>
<h3 ng-show="edit">Create New Product:</h3>
<h3 ng-hide="edit">Edit Product:</h3>
<form class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label">id:</label>
<div class="col-sm-10">
<input type="text" ng-model="product.id" placeholder="id">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">client_id:</label>
<div class="col-sm-10">
<input type="text" ng-model="product.client_id" placeholder="client_id">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">label:</label>
<div class="col-sm-10">
<input type="text" ng-model="product.label" placeholder="label">
</div>
</div>
</form>
<hr>
<button class="btn btn-success" ng-click="saveProduct()" ng-disabled="error || incomplete">
<span class="glyphicon glyphicon-save"></span> Save Changes
</button>
</div>
<script src = "com.model.js"></script>
<script src = "ProductController.js"></script>
</body>
</html>