Base solution for your next web application
Open Closed

ng-select error #4912


User avatar
0
kythor created

I'm trying to use ng-select in my Angular app.

I followed the instructions on <a class="postlink" href="https://github.com/ng-select/ng-select">https://github.com/ng-select/ng-select</a>

but when I try to use it on a "create-or-edit-xxx-modal.component" i get this error:

any ideas?

Error: Uncaught (in promise): Error: Template parse errors:
core.js:1448
message:"Uncaught (in promise): Error: Template parse errors:\nCan't bind to 'items' since it isn't a known property of 'ng-select'.\n1. If 'items' is an Angular directive, then add 'CommonModule' to the '@NgModule.imports' of this component.\n2. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("                       <div class="form-group">\r\n                                        <ng-select [ERROR ->][items]="phases"\r\n                                                    bindLabel="title"\r\n            "): ng:///AdminModule/CreateOrEditPlanModalComponent.html@52:51\n'ng-select' is not a known element:\n1. If 'ng-select' is an Angular component, then verify that it is part of this module.\n2. If 'ng-select' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("\r\n                                <div class="form-group">\r\n                                        [ERROR ->]<ng-select [items]="phases"\r\n              ...
promise:ZoneAwarePromise {__zone_symbol__state: 0, __zone_symbol__value: Error: Template parse errors:\nCan't bind to 'items…}
rejection:Error: Template parse errors:
stack:"Error: Uncaught (in promise): Error: Template parse errors:\nCan't bind to 'items' since it isn't a known property of 'ng-select'.\n1. If 'items' is an Angular directive, then add 'CommonModule' to the '@NgModule.imports' of this component.\n2. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("                       <div class="form-group">\r\n                                        <ng-select [ERROR ->][items]="phases"\r\n                                                    bindLabel="title"\r\n            "): ng:///AdminModule/CreateOrEditPlanModalComponent.html@52:51\n'ng-select' is not a known element:\n1. If 'ng-select' is an Angular component, then verify that it is part of this module.\n2. If 'ng-select' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("\r\n                                <div class="form-group">\r\n                                        [ERROR ->]<ng-select [items]="phases"\r\n       ...
task:ZoneTask {_zone: Zone, runCount: 0, _zoneDelegates: null, …}
zone:Zone {_properties: Object, _parent: Zone, _name: "angular", …}
__proto__:Object {constructor: , name: "Error", message: "", …}

2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Have you added NgSelectModule to your admin module's imports ?

    imports: [NgSelectModule],
    
  • User Avatar
    0
    kythor created

    oops, I only added it to app.module.ts thought it would trickle down to admin.module.ts

    still an Angular Novice :P

    thx for quick tip