typescript debugging

download

Make sure your tsconfig looks like this:

In order to include comments, remember to put “removeComments”: false

Now we can code up our app.ts:

We included “dom” in our “lib” array in our tsconfig.json file. Thus, we can use document object. We declare a button handler and an add function. We

In the terminal:

tsc

to create app.js. This app.js is created inside a dist folder as indicated by outDir in our tsconfig.json.

Thus, in our index.html, we are able to use it:

After that start the server:

npm start

Then start the debugger

Run through the initialization breakpoints.

Test the button handler breakpoint.