Reputation: 551
I want to use merge function from lodash. If I am including whole lodash , it increases bundle size . So I am trying to use function from lodash. But it is giving error.
import { merge } from 'lodash/merge';
or
import merge from 'lodash/merge';
Can anyone suggest me how to use this in angular 5 application ? I have installed following versions:
"lodash": "^4.17.5",
"@types/lodash": "^4.14.104"
Upvotes: 2
Views: 2083
Reputation: 4175
You can still do any JS way of things in TS (since it's a super-set)
Try with:
import merge = require('lodash/merge');
Upvotes: 1