oferh / ng2-completer

Angular 2 autocomplete component
http://oferh.github.io/ng2-completer/
MIT License
347 stars 172 forks source link

Problem while using ng2 completer witn Angular CLI #244

Closed jaiparkashyadav closed 7 years ago

jaiparkashyadav commented 7 years ago

Hi All,

I an new to Angular world. I want to use ng2 completer using angular CLI project.

I have followed steps mentioned on link https://www.npmjs.com/package/ng2-completer , except the system.js . Can you please suggest me where to set these things in case of Angular CLI.

I am getting below error:

ERROR Error: Uncaught (in promise): Error: Template parse errors: Can't bind to 'datasource' since it isn't a known property of 'ng2-completer'.

  1. If 'ng2-completer' is an Angular component and it has 'datasource' input, then verify that it is part of this module.
  2. If 'ng2-completer' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("

    Search captain

        <ng2-completer [(ngModel)]="captain" [ERROR ->][datasource]="captains" [minSearchLength]="0"></ng2-completer>
        </div>
        >!--<chart [options]="u"): ng:///InfoAlertModule/InfoAlertBackendComponent.html@39:49

    Can't bind to 'minSearchLength' since it isn't a known property of 'ng2-completer'.

  4. If 'ng2-completer' is an Angular component and it has 'minSearchLength' input, then verify that it is part of this module.

Thanks in advance , Regards, Jai

oferh commented 7 years ago

Hi @jaiparkashyadav,

Looks like something wrong with the way you imported Ng2CompleterModule. Better ask this type of questions on stackoverflow and add the AppModule and component code

jaiparkashyadav commented 7 years ago

Thanks for the response, it has been fixed, it was problem in importin gin AppModule.

dewiikaaa commented 7 years ago

@jaiparkashyadav would you please explain, how to fix your AppModule? I got that problem and I already check my AppModule, Evertything seems alright. thank you.

jaiparkashyadav commented 7 years ago

In my case i have not imported the Ng2CompleterModule into @NgModule({ imports: [ section