-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Learning Angular
By :

In the Types in Typescript 3.9 section, we learned about some of the basic types in the TypeScript language, which we usually meet in other high-level languages as well. In this section, we'll take a look at some of the advanced types that will help us in the development of an Angular application.
We use this type when we want to create an object from an interface
but include some of its properties, not all of them:
interface Hero { name: string; power: number; } const hero: Partial<Hero> = { name: 'Iron man' }
In the preceding snippet, we can see that the hero
object does not include power
in its properties.
Some languages, such as C#, have a reserved type when defining a key-value pair object or dictionary, as it is known. In TypeScript, there is no such thing. If we want to define such a type...