shlomiassaf / ngx-modialog

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

I get the following error: dialog.,_angular_core.Injector.create is not a function #389

Closed lexon0011 closed 7 years ago

lexon0011 commented 7 years ago

I used the version angular2-modal@3.0.2 with the following SystemJS configuration:

"paths": {
    'angular2-modal': 'node_modules/angular2-modal/bundle/angular2-modal.rollup.umd.js',
    'angular2-modal/plugins/bootstrap': 'node_modules/angular2-modal/plugins/bootstrap/bundle/angular2-modal-bootstrap.rollup.umd.js',
}

With this setup the modal dialogs are working. But if I update to ngx-modialog@4.0.0-beta.2 I get the following error:

dialog.,_angular_core.Injector.create is not a function
TypeError: _angular_core.Injector.create is not a function
    at DOMOverlayRenderer.render (http://localhost:8080/node_modules/ngx-modialog/bundle/ngx-modialog.rollup.umd.js:1389:46)
    at Overlay.createOverlay (http://localhost:8080/node_modules/ngx-modialog/bundle/ngx-modialog.rollup.umd.js:1347:48)
    at eval (http://localhost:8080/node_modules/ngx-modialog/bundle/ngx-modialog.rollup.umd.js:1329:47)
    at Array.map (<anonymous>)
    at Overlay.open (http://localhost:8080/node_modules/ngx-modialog/bundle/ngx-modialog.rollup.umd.js:1329:14)
    at Modal$$1.Modal.open (http://localhost:8080/node_modules/ngx-modialog/bundle/ngx-modialog.rollup.umd.js:1462:53)
    at OneButtonPresetBuilder.ModalOpenContextBuilder.open (http://localhost:8080/node_modules/ngx-modialog/bundle/ngx-modialog.rollup.umd.js:1794:30)

I updated my SystemJS config to the following:

"paths": {
  'ngx-modialog': 'node_modules/ngx-modialog/bundle/ngx-modialog.rollup.umd.js',
  'ngx-modialog/plugins/bootstrap': 'node_modules/ngx-modialog/plugins/bootstrap/bundle/ngx-modialog-bootstrap.rollup.umd.js',
}

I use angular@4.3.5

Is it a bug or a SystemJS configuration problem? Thanks!

In the attachment you find my full SystemJS config. systemjs.config.zip

shlomiassaf commented 7 years ago

ngx-modialog@4.0.0 and above supports angular 5+

You can use this plunker: http://plnkr.co/edit/lV7zsw7Yqossgs9JOfQU?p=preview to work with 4