angular-underscore-module.js 388 B

12345678
  1. /**
  2. * Let's you use underscore as a service from a controller.
  3. * Got the idea from: http://stackoverflow.com/questions/14968297/use-underscore-inside-controllers
  4. * @author: Andres Aguilar https://github.com/andresesfm
  5. */
  6. angular.module('underscore', []).factory('_', ['$window', function($window) {
  7. return $window._; // assumes underscore has already been loaded on the page
  8. }]);