This is Exercise 11.8, lecture on Typescript and other Javascript extensions, used in the course IDATA2301 Web technologies at NTNU, campus Aalesund.
The purpose of the exercise is to get your first experience with TypeScript. Note: be ready to use a bit of time. If you have never used Typescript before, there will be a bit of setup. the browser can't run Typescript directly, therefore you need to install a transpiler.
npm install --global typescript
tsconfig.js
hello.ts
and inside it create a TypeScript
code:
const greet = (person: string) => { console.log('TypeScript sends a greeting to ' + person); }; greet('Chuck');
tsc hello.ts
tsc.ps1 cannot be loaded because running scripts is disabled on this
system
, you can fix it as described
here: Run a
new PowerShell instance as the administrator and execute the following
command:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
. Press
Y when asked.
hello.js
inside your project directory.
hello.js
Javascript
there.
You can find a solution here.