ng2-datepicker icon indicating copy to clipboard operation
ng2-datepicker copied to clipboard

Angular 5 scroll on years problem

Open OscarPQ opened this issue 7 years ago • 4 comments

In Angular 5 with rxjs v5, there are an error when tries to change the year "NgDatepickerComponent.html:68 ERROR TypeError: rxjs.fromEvent is not a function at SlimScrollDirective.initWheel (ngx-slimscroll.umd.js:131)".

OscarPQ avatar Jul 12 '18 08:07 OscarPQ

I have the same problem:

version 3 seems to use rxjs v6, more specifically, the dependency ngx-slimscroll requires rxjs v6.

The workarounds I came up with:

The earlier versions 2.x.x (and its dependencies) use rxjs v5, so if you do not rely on any features from v3, you could try including the dependency with version 2 (I think 2.3.1 was the last v2).

Or you could explicitly install ngx-slimscroll with version 4.0.0 which uses rxjs v5 -- but I don't know if there are any side-effects, when "overriding" the dependency with an older version than referenced in the package.json

russaa avatar Jul 12 '18 17:07 russaa

Hi guys, also installing rxjs-compat in your project should help.

jkuri avatar Jul 12 '18 20:07 jkuri

@jkuri I have not tried it, but that would also require to update rxjs to v6, right?

since in an Angular 5 project, most of the dependencies would probably be using rxjs v5, I'd rather "downgrade" just the one dependency (ng2-datepicker/ngx-slimscroll) that requires v6, than "upgrade" all dependencies (at least for projects that have a bunch of extra dependencies; for smaller projects that would indeed be a viable option for me).
There are some breaking changes that the rxjs-compat does not address -- although these functions are probably rarely used, I'd rather not risk it, if there are a lot of dependencies that could potentially use those.

russaa avatar Jul 13 '18 11:07 russaa

I downgraded to ng2-datepicker 2.3.1 that did the trick for me. Not sure if that is feasible for you, or if you came up with a different solution?

speence avatar Feb 22 '19 16:02 speence