Member-only story

Properties and Modules in TypeScript/Angular

What is Angular (Part 6.5) / What is TypeScript?

Ankit Maheshwari
5 min readNov 21, 2019

How it works… | How to start…

If you haven’t covered Part — 6.4 of this series, I recommend you to check this link → Constructors and Access modifiers in TypeScript

My articles are open for everyone; non-member readers can read the article by clicking this Friend link.

Fundamentals of TypeScript👇

  1. Type annotations
  2. Arrow functions
  3. Interfaces
  4. Classes
  5. Constructors
  6. Access modifiers
  7. Properties
  8. Modules

6.5 Properties

As per our previous learning and understanding we can not access private and protected members outside of the class using a class object — look below👇 an invalid code at line no. 16 and 17

Try this code yourself to see the output!

Then, how to access private and protected members outside of the class?

Properties allow us to access private members

--

--

Ankit Maheshwari
Ankit Maheshwari

No responses yet