1.0.11 • Published 8 years ago

ng-linq v1.0.11

Weekly downloads
4
License
ISC
Repository
github
Last release
8 years ago

ngLinq

Installations

NodeJs

npm i ng-linq

Bower

bower i ng-linq

Html

<script src='bower_components/angular-linq/dist/ng-linq.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/ng-linq.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

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago