Classes, interfaces, and class inheritance

Now that we have overviewed the most relevant bits and pieces of TypeScript, it's time to see how everything falls into place to build TypeScript classes. These classes are the building blocks of TypeScript and Angular applications.

Although the noun class was a reserved word in JavaScript, the language itself never had an actual implementation for traditional POO-oriented classes as other languages such as Java or C# did. JavaScript developers used to mimic this kind of functionality, leveraging the function object as a constructor type, which would be later on instanced with the new operator. Other common practices such as extending our function objects were implemented by applying prototypal inheritance or by using composition.

Now, we have an actual class functionality, which is flexible and powerful enough to implement the functionality our applications require. We already had the chance to tap into classes in the previous chapter. Let's look at them in more detail now.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset