简体   繁体   中英

Include external JavaScript library in an Angular 2 TypeScript Project

I've created new Angular 2 Project. And want to include parse.com sdk. Added Parse.com as npm module

npm install parse --save

and installed typings for parse.com sdk

tsd install parse

Now i need to make the Parse Object available inside TypeScript Project. No idea how to let system include it with typings, so that i can access the Typed Parse Object from the Components.

Here is a repo: https://github.com/Borntofly/MyAngularProject.git

Theres my Repo: https://github.com/lohiarahul/Angular2-Silverlight-Starter

If you see, I have the Silverlight.Object() method inside my ts file. The "Silverlight" object is in the Silverlight.js included inside the index.html file.

To use the object inside the .ts, you just have to declare a var with the same name. It should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM