Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular2 returning lodash empty object

Tags:

angular

lodash

angular2 is returning lodash as an empty object.

npm install lodash --save
npm install @types/lodash --save

Imported as below :

import * as _ from "lodash";

_ is empty - what i'm doing wrong?

https://github.com/AngularClass/angular2-webpack-starter/issues/1302

like image 222
Rohit Avatar asked Mar 12 '26 19:03

Rohit


1 Answers

With "lodash": "^4.17.3" on dependencies and "@types/lodash": "^4.14.40" on devDependencies of the package.json file I was able to do

import * as lodash from 'lodash';

Wish that helps!

like image 66
SeleM Avatar answered Mar 15 '26 13:03

SeleM