Right way to import ng2-select
See original GitHub issueWhat is the right way to import this module in a Angular2 project ?
Currently, I import the module this way: app.module.ts
import { SelectModule } from '../node_modules/ng2-select/components/select.module.ts';
@NgModule({
imports: [
BrowserModule,
FormsModule,
HttpModule,
...
SelectModule, // ng2-select
],
....
But I have an error:
zone.js:1263 GET http://localhost:55976/traceur 404 (Not Found) (index):31 Error: Error: XHR error (404 Not Found) loading http://localhost:55976/traceur(…)
What am I doing wrong?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
Angular2 : trouble in integrating ng2-select - Stack Overflow
import { SelectModule } from "ng2-select/ng2-select";. then add "SelectModule" to the NgModule.imports array. Now in your component add the following import ...
Read more >ng2-select - npm
Start using ng2-select in your project by running `npm i ng2-select`. There are 27 other projects in the npm registry using ng2-select.
Read more >Angular Select - Valor Software
API. Usage. import {SelectModule} from 'ng2-select';. Annotations. // class Select @Component ...
Read more >ng2-select2 - npm Package Health Analysis - Snyk
ng2 -select2 · Angular2 wrapper for select2 For more information about how to use this package see README · Security · Popularity ·...
Read more >Can't import ng2-select SelectComponent - Stack Overflow
I'm trying to fix an issues in valor-software library ng2-select after install it in my node_modules ( npm install --save ng2-select ) ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had a bit of trouble getting this working as well. Are you using systemjs?
If so add the following to systemjs.config.js:
Then in the component you want to use the control:
@BenDevelopment you are having that error because of this line:
import { SelectModule } from '../node_modules/ng2-select/components/select.module.ts';
replace it with
import {SelectModule} from "ng2-select";
and it should disappear.