angular-underscorejs
v1.0.1
Published
Wrapper underscorejs with AngularJS
Downloads
382
Maintainers
Readme
angular-underscorejs
Wrapper underscorejs with AngularJS
Installation
You can choose your preferred method of installation:
- Through bower :
bower install angular-underscorejs
- Download from github : angular-underscore.js
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.