Introspecting the Decorated Class
Let's introspect the decorated class and use the Babel library to transpile the Angular decorator.
We'll cover the following
Once a class is decorated with Angular decorators like @Component
, @Pipe
, @Directive
, and so on, Angular can read the metadata to figure out what to do with them.
In our example, where we simulated the Angular @Component
decorator, we stored the properties given to the decorator into the metadata.
Verification by example
Let’s verify that the decoration actually worked.
Get hands-on with 1400+ tech skills courses.