angular-underscorejs

1.0.1 • Public • Published

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.

Package Sidebar

Install

npm i angular-underscorejs

Weekly Downloads

357

Version

1.0.1

License

MIT

Last publish

Collaborators

  • xen3r0