Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andersao/angular-table-sort
Angular Table Sort and Order
https://github.com/andersao/angular-table-sort
Last synced: about 2 months ago
JSON representation
Angular Table Sort and Order
- Host: GitHub
- URL: https://github.com/andersao/angular-table-sort
- Owner: andersao
- Created: 2015-01-25T19:52:11.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-05-12T23:00:05.000Z (over 9 years ago)
- Last Synced: 2024-11-09T23:57:16.249Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 152 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Angular Table Sort
===================Instalação
-------### Bower
Instale o pacote através do bower
```
bower install prettus-table-sort
```### Adicione a dependencia no modulo da sua aplicação
```javascript
angular.module('your-module', [
...,
'prettus.table.sort'
]);
```
Uso
-------```javascript
angular.module('your-module')
.factory('Clientes', ['$resource', function($resource){
return $resource('/clientes/:id');
}]);
``````javascript
angular.module('your-module')
.controller('ClientesController',['$scope','Cliente', function($scope, Cliente){$scope.clientes = [];
Cliente.get().$promise.then(function(response){
$scope.clientes = response;
});$scope.onSortTable = function(column, order){
Cliente.get({orderBy:column, sortBy:order}).$promise.then(function(response){
$scope.clientes = response;
});
};
}]);
``````html
Nome
Telefone
{{cliente.nome}}
{{cliente.email}}
{{cliente.telefone}}
```