-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
component.angularjs.ts
53 lines (52 loc) · 1.62 KB
/
component.angularjs.ts
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
import { ANGULARJS_MODULE } from '../../../angularjs.module';
import { ListSerieController } from './controller';
ANGULARJS_MODULE.component('listSerie', {
controller: class extends ListSerieController {
public constructor($scope: { $apply: Function }) {
super();
this.renderView = () => {
setTimeout(() => {
$scope.$apply();
}, 0);
};
}
},
template: `
<div>
<h5>List</h5>
<div>
<button class="btn btn-success" id="add" type="button" ng-click="$ctrl.add()">
Add
</button>
<button class="btn btn-info" id="start" type="button" ng-if="$ctrl.showPerformanceButton" ng-click="$ctrl.onStart()">
Performance
</button>
</div>
<table class="table" ng-repeat="element in $ctrl.elements track by $index" key="{index}">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">ID</th>
<th scope="col">Title</th>
<th scope="col">Unit</th>
<th scope="col">Action</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="serie in $ctrl.measuredSeries" key="{index}">
<td>{{ $index + 1 }}</td>
<td>{{ serie.getId() }}</td>
<td>{{ serie.getTitle() }}</td>
<td>{{ serie.getUnit() }}</td>
<td>
<button class="btn btn-info" id="edit-{{$index}}" type="button" ng-click="$ctrl.edit(serie)">
Edit
</button>
</td>
</tr>
</tbody>
</table>
<small>Duration: {{ $ctrl.duration }} ms</small>
</div>
`,
});