Search code examples
javascripttypescriptangularalertifyjs

How to use Alertify in Typescript?


I'm relative new to Angular2 so be patient with me.

I tryed to use Alertify.js in my Angular2 project for a custom dialog box but i can't get Alertify running... I'm not that familiar with js so i tryed to use alertify.js in Typescript or rather tryed to make a module out of that alertify.js file.

I found something about using .d.ts files and I also found the alertify.d.ts file on github but I cant figure out how to use it. I tryed several things but in the end I failed.

Is there anyone who can help me with this problem or can show me an alternative for a custom dialogbox?


Solution

  • I figured out how to use Alertify as easy as possible for me.

    I just bound it to my index.html with

    <script src="alertify/alertify.min.js"></script>

    and then just calling it alertify.METHODE().

    So making alertify global makes its very easy to use.