shlomiassaf / ngx-modialog

Modal / Dialog for Angular
http://shlomiassaf.github.io/ngx-modialog
MIT License
686 stars 242 forks source link

Version 4.x.x of the library is not compatible with Angular 4 #385

Closed erzaehlsalex closed 6 years ago

erzaehlsalex commented 7 years ago

The library is no more compatible with Angular 4. I'm using Angular 4.x and I installed the version 4.0.0-beta.1 of the ngx-modialog library. Now the following stack trace appears when I'm trying to open a modal.

ERROR TypeError: __WEBPACK_IMPORTED_MODULE_0__angular_core__.Injector.create is not a function at DOMOverlayRenderer.webpackJsonp../node_modules/ngx-modialog/bundle/ngx-modialog.es5.js.DOMOverlayRenderer.render

The problem is that Injector.create was introduced in Angular 5 beta 3. So right now, it is not possible to use the library with an angular version below 5 beta 3. Is there a workaround that you could provide by any chance?

Thanks in advance

shlomiassaf commented 7 years ago

The problem with angular 5 is deprecating support for ReflectiveInjector which is a big thing since the library used ReflectiveInjector when creating dialogs.

Creating a deprecation path from 4 to 3 is time consuming so I couldn't support that.

There is a tag for version 3.0.2, if you want to add some of the fixes created since then we can do that by creating a branch and PR's into it. I will publish the npm package for that...

This is why version 4 is beta

erzaehlsalex commented 7 years ago

Great, can you please create a new branch for that? So I can fix #379 on this branch and commit it, so you can publish that on npm. This would be awesome!

shlomiassaf commented 7 years ago

https://github.com/shlomiassaf/ngx-modialog/tree/v3.0.2