angular-linq
v1.0.6
Published
**NodeJs**
Downloads
168
Readme
ngLinq
Installations
NodeJs
npm i angular-linq
Bower
bower i angular-linq
Html
<script src='bower_components/angular-linq/dist/ngLinq.min.js'>
Use
<script src='bower_components/angular/angular.min.js'>
<script src='bower_components/linqjs/linq.min.js'>
<script src='bower_components/angular-linq/dist/ngLinq.min.js'>
<script>
angular('myApp', ['ngLinq'])
.controller('ctrl1', function($scope, $from){
$scope.data = [
{id: 2, text: 'item 2'},
{id: 1, text: 'item 1'},
{id: 3, text: 'item 3'},
];
var sortedByName = $from($scope.data).orderBy('$.text').toArray();
var allIds = $from($scope.data).select('$.id').toArray();
var allTexts = $from($scope.data).select('$.text').toArray();
//controller stuffs...
});
</script>
Depencencies
https://github.com/mihaifm/linq for bower
https://github.com/joaom182/linqjs for npm