shlomiassaf / ngx-modialog

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

Typescript definitions not up-to-date? #105

Closed ghost closed 8 years ago

ghost commented 8 years ago

image If I try to copy/paste the code from the code generator, it won't build as there is no definition for .size(), .isBlocking(), etc. on alert()

So this just won't work:

modal.alert()
    .size('sm')
    .isBlocking(true)
    .showClose(true)
    .keyboard(27)
    .title('Hello World')
    .body('A Customized Modal')
    .open();
ghost commented 8 years ago

This works, so definitely the TSD's are out of date.

var alert = this._modal.alert();
              (<any> alert)
                .size('sm')
                .isBlocking(true)
                .showClose(true)
                .keyboard(27)
                .title('Hello World')
                .body('A Customized Modal')
                .open();
shlomiassaf commented 8 years ago

No, it's fine.

You are using the wrong type annotation in the constructor.

Make sure you import the right Modal, which is to import the modal from the plugin and not from angular2-modal. e.g: import { Modal } fromangular2-modal/plugins/vex`

shlomiassaf commented 8 years ago

Also, TSD's are generated automatically with every build so the can't go "out of date" since they reflect the state of the JS files they are with.

What you refer to is ambient files created for non TS projects which are totally different.

ghost commented 8 years ago

Ah, sorry! I'm still thinking about ambient TSD's yes.

It's working now.... :+1: