-
-
Save beckyconning/a29417968f45f12e6a81 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* js controller */ | |
$scope.colorsTableParams = new ngTableParams({ | |
page: 1, | |
count: 10 | |
}, { | |
total: 0, | |
getData: function($defer, params) { | |
$http.get('vehicle-colors').success(function (data) { | |
$timeout(function () { | |
params.total(data.total); | |
$defer.resolve(data.slice((params.page() - 1) * params.count(), params.page() * params.count())); | |
}, 250); | |
}); | |
} | |
}); | |
$scope.color = {}; | |
/* view */ | |
<div id="color-list"> | |
<h2>Vehicle Colors</h2> | |
<p><strong>Page:</strong> {{colorstableParams.page()}}</p> | |
<p><strong>Count per page:</strong> {{colorstableParams.count()}}</p> | |
<table ng-table="colorsTableParams" class="uk-table uk-width-1-1 uk-text-center"> | |
<tr ng-repeat="color in colors"> | |
<!-- <td data-title="'ID'">{{color.id}}</td>--> | |
<td data-title="'Name'">{{color.caption}}</td> | |
<td data-title="'Manufacturer'">{{color.vmo_caption}}</td> | |
<!-- <td data-title="''">{{color.image}}</td>--> | |
</tr> | |
</table> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment