Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
Email
Telefone




{{cliente.nome}}
{{cliente.email}}
{{cliente.telefone}}

```