I am new to typescript. I find myself having to lear it because i am learning also angular.
One of my challenge was how can i practice the example codes? In the past with php, i could just use XAMPP to run a local server and i could test my scripts. But typescript does not run under apache. So wrote downs some notes just incase i need to use them again on setting it up on my windows PC.
visual studio code
to install is very simple, just follow these steps.
1. Donwload and Install free Visual Studio Code: https://code.visualstudio.com/
2. Donwload and Install Node.js : https://nodejs.org/
3. Open the comand line and install typescript using Node Package Manger with this simple command:
npm install typescript -g
4. Create a projects folder wherever you want in your file system.Example: C:\project
5. While you are still in the command line, cd to a folder you just created
6. In the project folder send this command to initiate a new typescript project:
7. open the C:\project in VS Code and reate new file called: webune.ts and add the following code:
save changes and hit Control+Shift+b
YOU WILL See at the bottom it says: Compilation complete. Watching for file changes.
NOTICE: you will see a new folder called scripts with webune.js and webune.js.map as COMPILED FROM TS
IF YOU GET CONFUSE BY THIS STEPS, FOLLOW THE VIDEO I PROVIDED BELOW, IT SHOWS EXACTLY THESE STEPS.
i had a hard time writing the steps, its easier if you just watch the vide for this step because it get a little complicated with hitting certain kesy on your keyboard for the configuration steps.
8. You will also need to create a folder called: scripts and configure Code by hitting control+shift+b and create a task, open tasks.json and make sure to:
CHANGE FROM: "sourceMap": false
CHANGE TO: "sourceMap": true
ADD: "outDir": "scripts/"
9. create a new index.html with the following HTML:
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script src="scripts/webune.js"></script></head></html>
Full video tutorial shows you all these steps