0

Sorry for newbie question on TypeScript.

I started the default TypeScript app on VS2015 and hit run.

I created a very simple class - clsTest with a single public number member. I created the declaration in the Greeter class and create the reference back to the file1.ts where the clsTest is located.

I compiled it and the default application still works (the clock is ticking).

However, as soon as I add the this._obj1 = new clsTest(); (see screen shot in red box), the whole app stops working. Have I done something super obvious? I tried digging for hours without much luck.

Your help is much appreciated.

enter image description here

Luka Kerr
  • 4,161
  • 7
  • 39
  • 50
EdX
  • 1

1 Answers1

0

So, I think - the problem is in your project configuration, if it is default - the compilation result would be two separate JS files with names app.js (which already declared in index.html) and file1.js (I think this one you forgot to declare in index.html);

So, if you would like to compile your code into a single JS file you should look at this topic

Community
  • 1
  • 1
Oleh Dokuka
  • 11,613
  • 5
  • 40
  • 65
  • I added the before the index.html looks like: TypeScript HTML App

    TypeScript HTML App

    – EdX Jan 08 '16 at 03:39
  • Looks like that was the problem. Missing the test.js inside the index.html. BTW, how do I see what is the actual test.js? I can't seem to find that file in my project explorer. Is there a setting that I have to enabled? – EdX Jan 08 '16 at 03:42