Advanced Types and Modules
Discover some advanced types and modules in TypeScript.
We'll cover the following...
Previously, we learned about some basic types in the TypeScript language that we usually meet in other high-level languages. In this lesson, we’ll look at some advanced types that will help us during Angular development.
The Partial
type
The Partial
type is used when we want to create an object from an interface but include some of its properties:
Press + to interact
interface Hero {name: string;power: number;}const hero: Partial<Hero> = {name: 'Boothstomper'}
In the preceding snippet, we can see that the hero
object does not include power
in its properties on ...