How to use lodash/underscore in angular config

970 Views Asked by At

I'm trying to use underscore or lodash in angular.module("",[]).config(function(){/* Here */}), but it is expecting a Provider and throwing Unknown provider.

  • Should I just use _ from global scope? (which is not preferrable)
  • Is there a way to inject utility like underscore/lodash in module config?
1

There are 1 best solutions below

5
Adam Nierzad On

After further investigation the module I linked wasn't suitable for your requirement. However, I did manage to dig up an older SO question which has some information about defining lodash in an Angular constant, this can be injected in to the .config() call.

Here is the question: How to make lodash work with Angular JS?

I hope this is more useful.