jbutko
8/1/2014 - 7:31 PM

AngularJS: Make Lo-dash work with #AngularJS

AngularJS: Make Lo-dash work with #AngularJS

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._;
  });
  
// From http://stackoverflow.com/questions/23862119/how-to-make-lodash-work-with-angular-js