Skip to content

Instantly share code, notes, and snippets.

@RajaJaganathan
Created September 19, 2015 08:37
Show Gist options
  • Save RajaJaganathan/addb2ba373017acf3a2c to your computer and use it in GitHub Desktop.
Save RajaJaganathan/addb2ba373017acf3a2c to your computer and use it in GitHub Desktop.
Using lodash in Angular Template
var myapp = angular.module('myApp', [])
// allow DI for use in controllers, unit tests
.constant('_', window._)
// use in views, ng-repeat="x in _.range(3)"
.run(function($rootScope) {
$rootScope._ = window._;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment