Reputation: 157
I have been trying to get this thing to work for quite a while now, and so far no solution that I have found has worked for me.
This is what I have:
//Test.ts
module t
{
export class Test
{
constructor ()
{
alert("test");
}
}
}
//Main.ts
/// <reference path="Test.ts" />
var test: t.Test = new t.Test();
As you can see I have two files, one is Main.ts and the other one is Test.ts. They are both in the same folder. Also if it helps I am using VS2012 and the Typescript plugin.
Thank you for the help! EDIT: Oh btw, I get the error (in chrome): Uncaught ReferenceError: t is not defined
Upvotes: 4
Views: 2907
Reputation: 251222
You need to include both scripts in your web page:
<script src="test.js"></script>
<script stc="main.js"></script>
Upvotes: 6