Thursday, November 06, 2014

making underscore.js dependency to angular js


var app = angular.module('app', ['underscore']);
app.controller('AppController', ['$scope', '_', function ($scope, _) {
  initialize = function () {
    _.keys($scope);
  }
  initialize();
}]);

underscore.factory('_', function () {
  return window._;
});