TypeScript - Classes

This module introduces you to Classes and how to use them in TypeScript.

Learning Objectives

The objectives of this module are to provide you with and understanding of:

  • What classes are
  • How to use inheritance in TypeScript Classes
  • How to use Access Modifiers
  • How to use Abstracts
  • How to use Structural Typing

Intended Audience

This learning path is aimed at all who wish to learn how to use TypeScript


It is essential you understand the face of contemporary web development to attend this course. You should have a good working knowledge of Javascript. Please note: Before attending this class delegates must have a Microsoft account (signing up one is free).


We welcome all feedback and suggestions - please contact us at to let us know what you think.


TypeScript uses the class syntactic sugar. Introducing the s2015 with some additions. In this module we'll examine class declarations and inheritance, TypeScripts access modifiers and how they work, using get and set with classes, how abstract classes are implemented, and the use of the static keyword. The vehicle class code on the screen is more or less pure JavaScript. We've added type declarations to the class properties and the function arguments to make it into a TypeScript class. Remember that this is all just syntactic sugar. The constructor method is called when the class instantiated using the new keyword. Functions in the class can be created without using the function keyword or assigning them to this. There's a gotcha with class declarations, they are not hosted in like other declarations in JavaScript. So make sure that they're always at the top of the file. Inheritance works by using the extend keyword. Again, there's nothing particularly TypeScript specific here on the inherited class. Default values can be provided in instructors though. There's another gotcha in this subclass. This will be undefined before you call a super function. So always do this as the first line in a constructor.





About the Author
Learning Paths

Ed is an Outstanding Trainer in Software Development, with a passion for technology and its uses and holding more than 10 years’ experience.

Previous roles have included being a Delivery Manager, Trainer, ICT teacher, and Head of Department. Ed continues to develop existing and new courses, primarily in web design using: PHP, JavaScript, HTML, CSS, SQL, and OOP (Java), Programming Foundations (Python), and DevOps (Git, CI/CD, etc). Ed describes himself as practically minded, a quick learner, and a problem solver who pays great attention to detail. 

Ed’s specialist area is training in Emerging Technologies, within Web Development. Ed mainly delivers courses in JavaScript covering vanilla JS, ES2015+, TypeScript, Angular, and React (the latter is authored by Ed) and has delivered on behalf of Google for PWAs. Ed has also developed a new suite of PHP courses and has extensive experience with HTML/CSS and MySQL. 

Ed is responsible for delivering QA’s Programming Foundations course using the Eclipse IDE. His skillset extends into the DevOps sphere, where he is able to deliver courses based around Agile/Scrum practices, version control, and CI/CD.

Covered Topics