I had problem with LODASH importing to Angular2 app, got answer on this post here and all working now.
Next problem I have is that I do not know how to make "twitter" npm module to work within the app.
Now I installed "npm install twitter" and tried to import it with:
import * as Twitter from 'twitter';
but I get "cannot find module 'twitter'. I tried adding to system.config without luck.
What am I doing wrong here? How should the code look like for import and using this twitter module?
Here is system.config in index.html:
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
}
},
map: {
lodash: 'node_modules/lodash/lodash.js',
twitter: 'node_modules/twitter/index.js'
},
meta: {
lodash: { format: 'amd' },
twitter: { format: 'amd' }
}
});