I'm trying to optimise my Angular 4 application by importing lodash functions globally to the app.module.ts. I tried:
import { some } from 'lodash/fp/some';
import _ from 'lodash/wrapperLodash';
However, I can't get the reference to that function in a component. This will throw an error:
_.some(myVar, { lat: null });
My dependencies (the ones related to the topic):
"devDependencies": {
"@angular/compiler": "^4.2.4",
"@angular/core": "^4.2.4",
"@types/lodash": "^4.14.104",
"lodash": "^4.17.5",
"typescript": "~2.3.3"
}
Error:
ERROR TypeError: __WEBPACK_IMPORTED_MODULE_0_lodash_fp_wrapperLodash___default.a.some is not a function