Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular 9 Support? #55

Open
PinkTiu opened this issue Feb 13, 2020 · 6 comments
Open

Angular 9 Support? #55

PinkTiu opened this issue Feb 13, 2020 · 6 comments

Comments

@PinkTiu
Copy link

PinkTiu commented Feb 13, 2020

Are there any plans to support Angular 9?

I get this error when trying to open a modal dialog.

core.js:5828 ERROR TypeError: Cannot read property 'createComponent' of undefined
    at ModalDialogComponent.push../node_modules/ngx-modal-dialog/__ivy_ngcc__/src/modal-dialog.component.js.ModalDialogComponent.dialogInit (modal-dialog.component.js:103)
    at ModalDialogService.push../node_modules/ngx-modal-dialog/__ivy_ngcc__/src/modal-dialog.service.js.ModalDialogService.openDialog (modal-dialog.service.js:27)
    at AppComponent.openNewDialog (app.component.ts:18)
    at AppComponent_Template_button_click_2_listener (app.component.html:4)
    at executeListenerWithErrorHandling (core.js:21593)
    at wrapListenerIn_markDirtyAndPreventDefault (core.js:21635)
    at HTMLButtonElement.<anonymous> (platform-browser.js:934)
    at ZoneDelegate.invokeTask (zone-evergreen.js:400)
    at Object.onInvokeTask (core.js:40744)
    at ZoneDelegate.invokeTask (zone-evergreen.js:399)
@turner1979
Copy link

turner1979 commented Feb 14, 2020

Having a similar issue when upgrading to Angular 9 ( I'm not using the Ivy compiler )

_ERROR TypeError: Cannot read property 'createComponent' of undefined
at ModalDialogComponent.push../node_modules/ngx-modal-dialog/src/modal-dialog.component.js.ModalDialogComponent.dialogInit (modal-dialog.component.js:59)
at ModalDialogService.push../node_modules/ngx-modal-dialog/src/modal-dialog.service.js.ModalDialogService.openDialog (modal-dialog.service.js:26)_

Setting static property to true for ViewChild in section below seemed to fix issue

Line 211 in node_modules/ngx-modal-dialog/src/modal-dialog.component.ts

ModalDialogComponent.propDecorators = {
    dynamicComponentTarget: [
        { type: ViewChild, args: ['modalDialogBody', { read: ViewContainerRef, static: true },] }]

@preeco-privacy
Copy link
Contributor

Here is a pull request for Angular 9 Support
#56

@little-pinecone
Copy link

I really like this package so I hope that the support for Angular 9 can be added.

In the meantime, I replaced Greentube/ngx-modal with preeco-privacy/ngx-modal:

$ npm uninstall ngx-modal
$ npm i @preeco-privacy/ngx-modal-dialog

And I fixed imports with:
import { ModalDialogService } from '@preeco-privacy/ngx-modal-dialog';
in my components
and
import { ModalDialogModule, ModalDialogInstanceService } from '@preeco-privacy/ngx-modal-dialog';
in my tests
and
import { ModalDialogModule } from "@preeco-privacy/ngx-modal-dialog";
in the app.module.ts file.

The @preeco-privacy/ngx-modal-dialog fork works with my Angular 9 project and my modals behave and look exactly like when I used the Greentube/ngx-modal dependency :)

@thecodemonk
Copy link

Just upgraded to Angular 9 and found this as well. Would like it fixed.

@Franky238
Copy link

Angular 11 problem, also with @preeco-privacy/ngx-modal-dialog. The problem is that I cant see the modal window but no error in console. Maybe problem with Ivy? Is there any solution how to avoid the problem with Angular 11 compatibility?

@molkamoalla
Copy link

I really like this package so I hope that the support for Angular 9 can be added.

In the meantime, I replaced Greentube/ngx-modal with preeco-privacy/ngx-modal:

$ npm uninstall ngx-modal
$ npm i @preeco-privacy/ngx-modal-dialog

And I fixed imports with:
import { ModalDialogService } from '@preeco-privacy/ngx-modal-dialog';
in my components
and
import { ModalDialogModule, ModalDialogInstanceService } from '@preeco-privacy/ngx-modal-dialog';
in my tests
and
import { ModalDialogModule } from "@preeco-privacy/ngx-modal-dialog";
in the app.module.ts file.

The @preeco-privacy/ngx-modal-dialog fork works with my Angular 9 project and my modals behave and look exactly like when I used the Greentube/ngx-modal dependency :)

this answer worked for me. Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants