What is a reflector class in Angular2?
1 answer
@Component() @View()
You probably see it attached to a class in Angular 2. The Angular team called these "annotations".
Only now ES7 proposal from Yehuda Katz can bring this metadata for all JavaScript. They will also be called Decorators, and you can already find decorators in TypeScript .
But wait! Angular has already called something "decorators". Need to rename this too. Who knew these concepts also have name conflicts.
So, I'm not sure what is called what's called these days, but if you can't wait for the dust to settle, I think the "reflectors" are related to the Reflector API for decorators , which you can read in a future article on decorators here ... They are very similar to "annotations".
+2
source to share