Skip to content

Commit 7a689fe

Browse files
author
hi
committed
Added DataTable page
Added a copy of table to make it data table.
1 parent 123144a commit 7a689fe

File tree

4 files changed

+62
-0
lines changed

4 files changed

+62
-0
lines changed

src/app/components/services/NavService.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
name: 'Table',
2424
icon: 'view_module',
2525
sref: '.table'
26+
},
27+
{
28+
name: 'Data Table',
29+
icon: 'view_module',
30+
sref: '.data-table'
2631
}
2732
];
2833

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
(function(){
2+
3+
angular
4+
.module('app')
5+
.controller('DataTableController', [
6+
'tableService',
7+
TableController
8+
]);
9+
10+
function TableController(tableService) {
11+
var vm = this;
12+
13+
vm.tableData = [];
14+
15+
tableService
16+
.loadAllItems()
17+
.then(function(tableData) {
18+
vm.tableData = [].concat(tableData);
19+
});
20+
}
21+
22+
})();

src/app/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ angular.module('angularMaterialAdmin', ['ngAnimate', 'ngCookies', 'ngTouch',
3737
data: {
3838
title: 'Table'
3939
}
40+
})
41+
.state('home.data-table', {
42+
url: '/data-table',
43+
controller: 'DataTableController',
44+
controllerAs: 'vm',
45+
templateUrl: 'app/views/data-table.html',
46+
data: {
47+
title: 'Table'
48+
}
4049
});
4150

4251
$urlRouterProvider.otherwise('/dashboard');

src/app/views/data-table.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!-- TODO: Replace table to table component when https://github.com/angular/material/issues/796 will closed -->
2+
<div class="table-responsive-vertical md-whiteframe-z1">
3+
<table id="table" class="table table-hover table-bordered">
4+
<thead>
5+
<tr>
6+
<th>#</th>
7+
<th>Issue</th>
8+
<th>Status</th>
9+
<th>Progress</th>
10+
</tr>
11+
</thead>
12+
<tbody>
13+
<tr ng-repeat="data in vm.tableData track by $index">
14+
<td data-title="ID">{{$index + 1}}</td>
15+
<td data-title="Issue">{{data.issue}}</td>
16+
<td data-title="Status">{{data.status}}</td>
17+
<td data-title="Progress">
18+
<md-progress-linear class="table-progress {{data.class}}"
19+
md-mode="determinate"
20+
value={{data.progress}}>
21+
</md-progress-linear>
22+
</td>
23+
</tr>
24+
</tbody>
25+
</table>
26+
</div>

0 commit comments

Comments
 (0)