Can't bind to 'items' since it isn't a known property of 'ng-select'.
Hello, I am using angular 2.0.1 and have imported the module.
can someone help? thanks
I've faced with the same problem. After reading some other issues, I made some corrections in my code:
- Import SelectModule to the your module:
import { SelectModule } from 'ng2-select';
@NgModule({
imports: [ SelectModule ]
})
- Change "initData" property to "active" property - if you need it:
<ng-select [active]="yourActiveItems" ...></ng-select> - Remove SELECT_DIRECTIVES at all - you should use SelectModule now (see 1).
I'm having the same exact issue as well. Does anyone have a working sample angular 2 project with this?
@shima20 if you are lazy loading modules. you have to import it on lazy loaded module
@k1ng440 what exactly do you mean? do you have an example? I don't believe I'm lazy loading.
You have to import the forms module into your component module because [(ngModel)] requires it:
import { FormsModule } from '@angular/forms';
imports: [FormsModule],
I have exactly the same problem. Does anyone have actual working Angular 2 example with this library?
I am also facing same problem. please help anyone...
[1]
npm install --save @ng-select/ng-select
[2] app.module.ts - import { NgSelectModule } from '@ng-select/ng-select'; import { FormsModule } from '@angular/forms';
@NgModule({ declarations: [AppComponent], imports: [NgSelectModule, FormsModule], bootstrap: [AppComponent] }) export class AppModule {}
[3] Include in style.scss - @import "~@ng-select/ng-select/themes/default.theme.css"; // ... or @import "~@ng-select/ng-select/themes/material.theme.css";
Reference - https://github.com/ng-select/ng-select
I had the same problem and it was caused by missing dependency (@angular/cdk).
Installed it and the problem was solved.
Getting this errror node_modules/@ng-select/ng-select/lib/config.service.d.ts:16:21 - error TS2694: Namespace has no exported member 'ɵɵFactoryDeclaration'. 16 static ɵfac: i0.ɵɵFactoryDeclaration<NgSelectConfig, never>;
Can anyone help, please?
Add imports: [NgSelectModule, FormsModule] on component ...spec.ts
before compiling will import the specific module
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ InstituicaoComponent ],
imports: [NgSelectModule, FormsModule]
})
.compileComponents();
}));
I am facing same issue in angular 16, anyone have solution