3

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?

user229044
  • 232,980
  • 40
  • 330
  • 338
marvstar
  • 417
  • 5
  • 21

2 Answers2

2

If you don't want to use tsd or typings then the simplest way is to copy alertify.d.ts file to your source dir, include alertify.js using script tag and add next line to main.ts/boot.ts:

/// <reference path="../path-to/alertify.d.ts" />
kemsky
  • 14,727
  • 3
  • 32
  • 51
2

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.

marvstar
  • 417
  • 5
  • 21