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

https://github.com/alvaropaco/angularjs-arrays

Array functions for AngularJs
https://github.com/alvaropaco/angularjs-arrays

Last synced: about 2 months ago
JSON representation

Array functions for AngularJs

Awesome Lists containing this project

README

        

angularjs-arrays
================

Array functions for AngularJs
This functions are implemented like php functions based on performance.

Installation


  • Just Download the .js file

  • Include into yours index.htmlmain file like:
    ```
    src="scripts/libs/Array.js"
    ```

Injection


.controller('UsersCtrl', function ($scope, $location, $route, $modal, $routeParams, $q, $array, …){

Usage

Example 1:

```javascript
var arr = [1,2,3] , var in = $array.in_array(1,arr) // in = true
```
Example 2:

```javascript
var ordered_arr = array({3:'value'}, {2:'value'}, {'a':'value'}, {'b':'value'});
var key = array_search(/val/g, ordered_arr); // or var key = ordered_arr.search(/val/g); //returns '3'
```