Attached .pptx
file is the presentation file for this course.
There are going to be two parts for the course.
We are going to create a new TypeScript
app from scratch.
Our goal is to make this piece of code to work:
const listOfAnimals = new List<Animal>();
listOfAnimals.add(new Dog("Joy"));
listOfAnimals.add(new Dog("Moni"));
listOfAnimals.add(new Cat("Marshel"));
listOfAnimals.add(new Horse("Din"));
listOfAnimals.print();
/*
Expected output:
Hello I am Joy!
Hello I am Moni!
Hello I am Marshel!
Hello I am Din!
*/
-
Create a new empty folder.
-
In the root folder add a folder called src. Inside of it we will have most of our code, organized in sub folders and
.ts
files. -
In the root folder run
tsc --init
command (tsconfig.json file should be created). Edit your tsconfig.json if needed (change configuration etc.) -
In the root folder file run
npm init
command (package.json file should be created) Edit your package.json if needed (change configuration etc.) -
At this point your folder should look like:
src/
├─ some-file.ts
├─ some-inner-folder/
| └─ some-file.ts
└─ package.json
└─ tsconfig.json
- Add some files to src folder compile and run.