Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS - Error '_' not defined

When I try to use lodash in my angular applications (built from angular-seeds) it's returning '_' not defined but the lodash package is in my node_modules. What else do i need to do to include it?

like image 879
IAmAkittycatAMA Avatar asked Oct 26 '25 08:10

IAmAkittycatAMA


1 Answers

The packages that you have installed using 'npm' are saved in node_modules that are used for server side whereas packages installed using 'bower' are saved in 'public/lib' folder. So the correct way to install lodash for angularjs is

bower install --save lodash
like image 58
Garima Avatar answered Oct 29 '25 09:10

Garima



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!