1

In my project one module has implemented using underscore library. Now for going forward we need to use lodash.For injecting lo-dash in project angular.module('myModule').constant('_', window._); we have to depend on window. As we are using underscore library in same project it is also accessible by “window._”. As both of them uses “window._” there will be ambiguity of one over another. What is the solution for this? am using this in angular JS Project.

Rahul Rajput
  • 1,427
  • 3
  • 17
  • 38
  • 7
    Perhaps you could bin underscore and just use lodash from now on? [lodash is just a superset of underscore](http://stackoverflow.com/a/13898916/1136527), so I doubt you'll run into any problems – Alex McMillan May 28 '15 at 10:14
  • 4
    http://underscorejs.org/#noConflict and https://lodash.com/docs#noConflict – Grundy May 28 '15 at 10:14
  • https://github.com/rockabox/ng-lodash using this will be good idea?? – Rahul Rajput May 28 '15 at 10:17
  • @AlexMcMillan Do i need to make any changes in code where underscore is already used. or lodash is compatible with underscore functionality. As one complete module uses underscore functionality. – Rahul Rajput May 28 '15 at 10:33

0 Answers0