I started simple Angular 2 app, all working. But when I add import of lodash and try to use it, I get errors and the app stops working, and can\'t figure out what is the pro
Perhaps you could try this configuration at SystemJS level:
System.config({
(...)
map: {
lodash: 'node_modules/lodash/lodash.js'
},
meta: {
lodash: { format: 'amd' }
}
}
In a TS file, you can then use it as described below:
import _ from 'lodash';
_.forEach([1,2,3], function(e) {
console.log(e);
});
This issue could help you: https://github.com/systemjs/systemjs/issues/951.
Thierry