Angular 2 add javascript lib

481
June 28, 2017, at 03:52 AM

I want to add this library to my angular webapp

<script src="https://secure.mlstatic.com/sdk/javascript/v1/mercadopago.js"></script>

But i havent been able to do it. What would be the correct way to integrate a javascript library?

Answer 1

The underlying issue is that Typescript won't understand the types used by the library because it's in JavaScript form. Take a look on this github site for the library you want to load and then you can install the type signatures:

https://github.com/DefinitelyTyped/DefinitelyTyped

Rent Charter Buses Company
READ ALSO
JS Debugging object, append messages to unknown objects

JS Debugging object, append messages to unknown objects

I want to add different key's to an object without needing the directly assign them before handSo for example, let's first set the object to null, but if the user enabled it then define an object:

401
Which technology for developing an online game? [on hold]

Which technology for developing an online game? [on hold]

I would like to code my own RPG online gameI'm a kind of newbie in web development but not in the web

251
Defining a user with props or deconstruction in React

Defining a user with props or deconstruction in React

New to React and am trying to figure how I can add/define {user}within my code belowI simply keep getting an error on user not defined when I try to run it

377
How can I use scrollIntoView() under jQuery syntax?

How can I use scrollIntoView() under jQuery syntax?

I need to do let the last reply scroll into view using jQueryHere is my code:

390