shlomiassaf / ngx-modialog

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

Is it working for angular 2.1? #265

Open mkonars opened 7 years ago

mkonars commented 7 years ago

Can anyone confirm that it is working for angular 2.1?

ssashok10 commented 7 years ago

its not working with angualr 2.1 for me too....I am just waiting for some samples from the author. I am using custom modal in one of my applications.

shlomiassaf commented 7 years ago

The demo app is using angular 2.1.2

What's not working? what error message do you get?

ssashok10 commented 7 years ago

issue number #249. I am currently using Angular 2.3.1. Is there any sample application that i can refer to implement the custom dialog on it?

shlomiassaf commented 7 years ago

@ssashok10 I dont understand.

Are you having issues with Angular 2.3.1, that is Angular 2.0.0 worked but the next version did not?

Or

You're having issues upgrading from angular2-modal@2.0.0-beta.11?

As for system.js config, I can't help much here I just hate that module system... There are plenty of closed issues about that, do a quick search... Here is one closed just today

ssashok10 commented 7 years ago

Below are the details,

My Angular version is 2.3.1 and i am upgrading "angular2-modal" from "2.0.0-beta.13" to "2.0.2". I am using WebPack and removed all the SystemJS dependencies. I am getting the below error,

"File I:.//SampleApp/node_modules/angular2-modal/index.d.ts" is not a module"

Note : Everything was working when i am using the version "2.0.0-beta.13". The error happened in the moment when i upgraded to the latest version of "angular2-modal".

ssashok10 commented 7 years ago

Is there any plnkr sample something like the below?

http://embed.plnkr.co/hwbmF9/

This sample uses systemjs and the old "Angular2-Modal" V1.1.1. It would be very nice to see a sample application with the latest version 2.0.2 and webpack.

ssashok10 commented 7 years ago

I have upgraded the TypeScript version from 1.8.x to 2.0.6 and the below build error is gone now,

"node_modules/angular2-modal/index.d.ts" is not a module.

The build is successful. However, i am getting a run time error now. I am using WebPack for bundling.

Here is the place where i am getting the error on the bundle JS file,

/***/ },
/* 679 */
/***/ function(module, exports) {

    export { BSModalContext, BSModalContextBuilder } from './modal-context';
    export { BSModalContainer } from './modal-container.component';
    export { BSMessageModal, BSMessageModalTitle, BSMessageModalBody, BSModalFooter } from './message-modal.component';
    export { MessageModalPresetBuilder } from './presets/message-modal-preset';
    export { ModalOpenContext, ModalOpenContextBuilder } from 'angular2-modal';
    export { OneButtonPresetBuilder } from './presets/one-button-preset';
    export { TwoButtonPresetBuilder, PromptPresetBuilder } from './presets/two-button-preset';
    export { Modal } from './modal';
    export { BootstrapModalModule, providers } from './bootstrap.module';
    //# sourceMappingURL=index.js.map

/***/ },
/* 680 */

Here is the run time error message,

"Uncaught SyntaxError: Unexpected token export"

Is it because you keep the "export" statements inside a function?

Note : The file "tsconfig.json" has the "target" property of "es5".

Update : I just noticed the below on your tsconfig.json

"lib": [ "dom", "es6" ]"

Is it causing "WebPack" to include the "export" statements from this component? The default library for the target "es5" is "es5" as per TypeScript documentation.