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.
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 .
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:
Now, did you do all this and still don't get it working?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With