Reputation:
im trying to create a application with angular 2 ,i using videogular 2,and i install videogular 2 with npm and i check my node_modules and videogular2 exist in directory but when i run my application occur an error :
angular2-polyfills.js:126 GET http://localhost:3000/node_modules/videogular2/core 404 (Not Found)
angular2-polyfills.js:390 Error: Error: XHR error (404 Not Found) loading
and this is my configuration :
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
}
},
map: {
'videogular2': './node_modules/videogular2'
}
});
System.import('app/main')
.then(null, console.error.bind(console));
Upvotes: 0
Views: 563
Reputation: 21
just in case if anybody needs answer
this is what you would need to include in you system.config.js after installing via npm install videogular2
map:{
'videogular2': 'node_modules/videogular2',
},
packages:{
'videogular2':{
main: 'core.js',
defaultExtension:'js'
}
}
Happy coding......
Upvotes: 2
Reputation: 202286
I would add a packages block for videogular2 in the SystemJS configuration:
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
},
videogular2: { <-------
defaultExtension: 'js'
}
},
map: {
'videogular2': './node_modules/videogular2'
}
});
System.import('app/main')
.then(null, console.error.bind(console));
Upvotes: 1