Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up AngularJS for TypeScript in Sublime Text 3

Good day, I am trying to use AngularJS in TypeScript, problem is, i have just shifted to Sublime Text 3 from VS2013, for some OS reason, I have dug around google for answers, but i haven't found one. so I'd like to know how i could setup AngularJS for TypeScript in Sublime (note: TypeScript is already configured in Sublime; I'm looking specifically for how to set up AngularJS for TypeScript). thanks.

like image 289
user3414321 Avatar asked Aug 28 '15 23:08

user3414321


People also ask

How do I make TypeScript support in Sublime Text?

You can do this by pressing Ctrl + shift + p write ipc and press enter to open the Package Manager. After that, type TypeScript and choose the first option which is published by http://typescriptlang.org. Note: For Mac OS users, use Command (⌘) + shift + p instead of Ctrl + shift + p .


1 Answers

Not sure if I got your question, but pretty much, after installing the plugin you need to install AngularJs TypeScript Definitions and reference them in your code.

For definition management I use tsd. It's pretty much like bower (oh God... one more dependency manager...). You can install it using npm install tsd -g, then, in your project folder initialize tsd repo

tsd init

And install AngularJs Definitions

tsd query angular --action install --save

And finally reference them in your source code by adding the reference directive (tsd will install each definition separately, and tsd.d.ts consolidates all installed dependencies, so you don't need to bloat your files with references):

/// <reference path="typings/tsd.d.ts" />

And that's it. You should be able to get code hint now:

AngularJs typescript code hint

Now, did you do all this and still don't get it working?

like image 171
Caio Cunha Avatar answered Nov 14 '22 21:11

Caio Cunha