Classes

Developed with
QA

Contents

keyboard_tab
Typescript
1
Inheritance
PREVIEW1m 24s
2
Access Modifiers
PREVIEW4m 17s
4
Abstracts
1m 52s

The course is part of this learning path

play-arrow
Inheritance
Overview
DifficultyBeginner
Duration13m
Students15
Ratings
5/5
starstarstarstarstar

Description

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

Prerequisites

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).


Feedback

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

Transcript

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.

Lectures

 

 

 

About the Author

Students1159
Labs8
Courses29
Learning paths5

An outstanding trainer in software development with more than 15 years experience as a Corporate and Apprentice Trainer, ICT Teacher and Head of Department, with a passion for technology and its uses. Continuing to develop existing and new skills and courses, primarily in web design using PHP, JavaScript, HTML, CSS and SQL but also OOP (Java), programming foundations (Using Python), DevOps (Git, CI/CD, etc) and Agile/Scrum. Practically minded, a quick learner and a problem solver with an attention to detail to ensure high quality outcomes.