angular-underscorejs

Wrapper underscorejs with AngularJS

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
angular-underscorejs
001.0.17 years ago7 years agoMinified + gzip package size for angular-underscorejs in KB

Readme

angular-underscorejs
Wrapper underscorejs with AngularJS

Installation

You can choose your preferred method of installation:

Usage

Include angular-underscore.js in your application.
<script src="bower_components/angular-underscorejs/angular-underscore.js"></script>

Add the module xen3r0.underscorejs as a dependency to your app module:
angular.module('myApp', ['xen3r0.underscorejs']);

Inject service and use underscorejs functions:
angular.module('myApp')
  .controller('MyController', ['_', controllerFn]);
  
function controllerFn(_) {
  var myTab : [
    {
      id: 1,
      name: 'PHP'
    },
    {
      id: 2,
      name: 'JS'
    },
    {
      id: 3,
      name: 'HTML'
    }
  ];
  var indexedTab = _.indexBy(myTab, 'name');
}

Check Underscorejs for more functions.

License

Released under the terms of the MIT License.