Learn Angular for Back-End Developer (Part 2) -TypeScript Fundamentals

An easy guide to learn TypeScript quickly to be comfortable with Angular applications

What is Typescript ?

TypeScript logo
npm install -g typescript
tsc --version
tsc myFile.ts
node myFile.js

Type Annotations

Typescript is a typed language like C# and Java
Typescript is a typed language like C# and Java
Type Annotations
var keyword declares a globally-scoped or function-scoped variable
var keyword declares a globally-scoped or function-scoped variable
var keyword
let keyword declares a block-scoped variable
let keyword declares a block-scoped variable
let keyword

Type Assertions

Type assertion similar to type casting in other languages like C# and Java
Type assertion similar to type casting in other languages like C# and Java
Type assertion

Arrow Functions

(param1, param2, ..., paramN) => expression
Arrow function is called a lambda function in other languages.
Arrow function is called a lambda function in other languages.
Arrow function/ Old function declaration

Interfaces and Classes

Interface is a shap
Interface is a shap
TypeScript Interface usage
TypeScript interface with function signature
TypeScript class

Constructor and Access Modifiers

Constructor and access modifiers
Constructor with optional parameters
Refactoring Person Class by adding access modifiers in the constructor

Properties

Getter and setter

Modules

Module  group classes, interfaces, functions into one unit
Module  group classes, interfaces, functions into one unit
Create a new module
Import/Export Typescript Module
Import/Export Typescript Module
import Person module

Conclusion

Learn More / Resources

Senior Full Stack .Net / Angular Developer, Cloud & Azure DevOps, T-Shirt Designer, Husband, and Father.