Getting Started with the Anuglar2Spa Template - Adding a Angular2 dependency #900

Closed
opened 2025-08-09 17:18:06 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @spottedmahn on 3/24/2017

After reading #770 I'm still not clear on how I would add this library: https://www.npmjs.com/package/angular2-bootstrap-switch to my project. It seems different than #770 in that it's an angular2 component.

I'm thinking I need to add it to webpack.config.vendor.js? I've tried this, but when I try to add it to my declarations array in my app.module.ts I get "Exception: Call to Node module failed with error: Error: Unexpected value 'SwitchComponent' declared by the module 'AppModule'"

module.exports = (env) => {
const sharedConfig = {
...
entry: {
vendor: [
...
'angular2-bootstrap-switch'
]
},
...

Btw, thanks for your prompt response on my original question #788 !

*Originally created by @spottedmahn on 3/24/2017* After reading #770 I'm still not clear on how I would add this library: https://www.npmjs.com/package/angular2-bootstrap-switch to my project. It seems different than #770 in that it's an angular2 component. I'm thinking I need to add it to webpack.config.vendor.js? I've tried this, but when I try to add it to my declarations array in my app.module.ts I get "Exception: Call to Node module failed with error: Error: Unexpected value 'SwitchComponent' declared by the module 'AppModule'" module.exports = (env) => { const sharedConfig = { ... entry: { vendor: [ ... 'angular2-bootstrap-switch' ] }, ... Btw, thanks for your prompt response on my original question #788 !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#900
No description provided.