Understanding Typescript

Possibly save 1 hour of your time: Here are some reminders when using Typescript.

  • Resource Link – Create variable using let rather than var:

https://www.typescriptlang.org/docs/handbook/variable-declarations.html

  • Resource Link – Include other javascript by using node.js npm to install both the library itself and typed-definition for the library. In this example, I am installing mapbox-gl and its typed-definition. You can go to https://www.npmjs.com and find your typed-definition.

  npm install mapbox-gl

  npm install –save @types/mapbox-gl

If you cannot find it in npm package manager, you can try Typed definition in github.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s