7

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.

1 Answer 1

8

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?

Sign up to request clarification or add additional context in comments.

2 Comments

Yes thanks, it's just that my common sense went on vacation that day.
It looks like people is still working on a tsd for Angular 2 github.com/angular/angular/pull/2333. But you could also try tsd query angular2 --action install --save

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.