0

I was wondering what the negative consequences of this might be, since it's obviously circumventing the intended typing system used by Angular.

For reference, I'm using it so that I can use require.

Does anyone know why this might be a good/bad idea?

edit: I'm not asking about how to use this or what the alternatives are (which I've seen, and I recognize that would make this a duplicate question). I'm specifically, and ONLY, asking how this could negatively impact Angular's inner workings and reliance on TS typings. I did not see that specific question answered in any of the similar posts.

yoursweater
  • 1,883
  • 3
  • 19
  • 41
  • Possible duplicate of [Cannot find name 'require' after upgrading to Angular4](https://stackoverflow.com/questions/43104114/cannot-find-name-require-after-upgrading-to-angular4) – bugs Jun 19 '18 at 13:16
  • 1
    The same negative consequences of circumventing typings for anything. You could possibly use the type incorrectly, and it wouldn't be caught until runtime. – Heretic Monkey Jun 19 '18 at 13:22
  • `declare var` seems to me to channel through other third party library written in `Javascript` but anything to do with `Angular`. The consequence only depends on how compatible between this third party library and angular. – windmaomao Jun 19 '18 at 13:23
  • Possible duplicate of [What is TypeScript and why would I use it in place of JavaScript?](https://stackoverflow.com/questions/12694530/what-is-typescript-and-why-would-i-use-it-in-place-of-javascript) – Heretic Monkey Jun 19 '18 at 13:27

0 Answers0