title: How to retrieve a component's metadata in Angular
body: <p>An Angular component has decorators:</p>
  
  <pre><code>@Component({ ... })
  export class MyAngularComponent {
    @Input() myInputParam: MyType;
    @Input() myOtherInputParam: MyOtherType;
    @Output() myOutputParam: MyOtherOutputType;
  }
  </code></pre>
  
  <p>I've got an Angular library where a lot of code repetitions could be avoided (and bundle size reduced) if I could programmatically retrieve Angular's <code>@Input()</code> decorators inside a given component class <em>(that belongs to the library, though)</em>.</p>
  
  <p>But I have doubts on the portability of such an implementation. I've read somewhere that the Reflect polyfill (needed to read decorators at runtime) isn't needed if the Angular app has been built with AoT enabled (and given that only Angular decorators are used). So I presume I can't just use <code>Reflect.*</code>. How does Angular stores the decorators? Is there a reliable, future-proof way to read them?</p>
  
  <p>Minification shouldn't be a problem since that would be used to read decorators of library's components only, so I have control on this.</p>
  
  <p>So, if that's doable in a portable way (or not, I'm still interested otherwise), how can I read those decorators?</p>