oferh / ng2-completer

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

Please allow me to add PR to fix #442 #452

Closed MrNocTV closed 4 years ago

MrNocTV commented 4 years ago

I have working solution for #442 I have traced down the root causes:

  1. The code is not correctly loading the completer in CompleterCmp. Please check this for more info.
  2. Putting the code to subscribe on completer in ngOnInit doesn't work, we have to put it in ngAfterViewInit

Can I be added as a contributor so that I can make a PR?

Thank you in advance.

stanislas commented 4 years ago

@MrNocTV I stumbled upon the same problem. Thank you for tracing down the root causes. Could you publish your fix on your fork? That would be of great help.

greywire commented 4 years ago

Definitely second this! Its preventing my company releasing our angular 8 upgraded app...

MrNocTV commented 4 years ago

@stanislas I have created a PR for it. You can take a look here.

osterland commented 4 years ago

@MrNocTV any Idea why i get in all my .ts imports "Cannot find module 'ng2-completer'", when i try to use youre PR with npm install oferh/ng2-completer#pull/453/head --save ?

TY!

greywire commented 4 years ago

@MrNocTV any Idea why i get in all my .ts imports "Cannot find module 'ng2-completer'", when i try to use youre PR with npm install oferh/ng2-completer#pull/453/head --save ?

TY!

Yeah I'm getting the same thing... using this:

npm install MrNocTV/ng2-completer#fix/fix-selected-event-not-working-on-3.0.3 --save

and getting this error:

ERROR in app/app.module.ts:26:36 - error TS2307: Cannot find module 'ng2-completer'.

osterland commented 4 years ago

@greywire

looks like u are in a little time pressure - if u want a quick fix ( like me ) do the following: 1) go to your node modules and find die ng2-completer 2) ( and thats now a little different from the PR ) u need to edit the 2 files ng2-completer.js in esm5 and in esm2015 ( probably the one thtat matchs ur ts would be enough ? ) 3) in these two files u basically do what @MrNocTV did in his PR (in the completer move the stuff from the ngOnInit() in the ( alrdy existing) ngAfterViewInit()

downside is u have to do this after every npm i - until the package is fixed

hope it helps!

lizelleboshoff commented 4 years ago

Can we please get this merged? I'ts preventing us from upgrading to Angular 9. Thank you.

oferh commented 4 years ago

@MrNocTV merged the PR thank you for the contribution!