Geeks With Blogs

News Please visit me at my new blog!!

profile for Aligned at Stack Overflow, Q&A for professional and enthusiast programmers
"free in Christ Jesus from the law of sin and death." Romans 8:2 (ESV) Check out the Falling Plates video on YouTube.
more about the Gospel
And then listen to Francis Chan speaking at LifeLight in SD.

Programming and Learning from SD

I was trying to reference an existing JavaScript file from my new TypeScript file using

/// <reference path="app.js"/>

It wasn’t being found, until I found that you need to have the file saved as UTF-8. To do this in Visual Studio 2012 on Windows 7, click on file –> save as –> then click on the down arrow of the save button and choose save with encoding.

TypeScript then found my JavaScript and started parsing. Now I have a lot of errors  when I build the solution (other references aren’t correct (the file doesn’t exist, but it does), certain classes don’t exist in my setup namespaces (that I created, not using the modules of TypeScript))


This Codeproject article goes pretty in-depth, I’m going to look into this further, or just go back to plain old JavaScript and copy the compiled JavaScript of what I’ve done so far.

Posted on Friday, July 12, 2013 11:51 AM JavaScript , TypeScript | Back to top

Comments on this post: Referencing files TypeScript 0.9

# re: Referencing files TypeScript 0.9
Requesting Gravatar...
Thank you for the fully detailed response! Very helpful.

This totally makes sense. However it raises an issue about having a TypeScript project which some people may be using Visual Studio to work on and some people may be using another IDE (eg WebStorm). In this situation it would be necessary to use /// references for the people not using Visual Studio. MCXBullionTips
Left by Heribak on Nov 30, 2015 7:36 AM

Your comment:
 (will show your gravatar)

Copyright © Aligned | Powered by: