rhostem / ng2-simple-autocomplete

ng2-simple-autocomplete
MIT License
6 stars 2 forks source link

ng2-simple-autocomplete is not a known element #2

Open ChaudhryAtif opened 6 years ago

ChaudhryAtif commented 6 years ago

After installing, and importing, when I try to follow the examples and paste the code in the html, I get the following error:

Angular: 'ng2-simple-autocomplete' is not a known element. 1. If 'ng2-simple-autocomplete' is an Angular component, then verify that it is part of this module. 2. If 'ng2-simple-autocomplete' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

image

ChaudhryAtif commented 6 years ago

@rhostem any suggestion?

rhostem commented 6 years ago

Sorry I couldn’t  figure out exact problem of this issue. It looks like something related to AOT compilation and angular-cli.

https://github.com/angular/angular/issues/15890

So I’m going to version up this repo for AOT compatibility with angular-library-seed guided by ‘How to create AOT/JIT compatible Angular 4 library with external SCSS/HTML templates ‘. But it will take a time…

If you’d like to use this component in your app now, copying original sources from src/ng2-simple-autocomplete folder will be temporary solution.

And this component works well with angular-starter using webpack, not using angular cli. (But build failed in AOT mode. and succeed in normal build)

ChaudhryAtif commented 6 years ago

@rhostem When do you expect to get an update released?

rhostem commented 6 years ago

I'm not sure. Becuase I dont have focus on Angular for now.

ChaudhryAtif commented 6 years ago

@rhostem Alright. In the meantime, I should be able to copy index.ts and model.ts files in src/ng2-simple-autocomplete and use it as instructed?

rhostem commented 6 years ago

Yes. then add the component to 'declarations' array of your module.