title: Is it possible to dynamically set a components @Input at run-time?
body: <p>Say I have a <code>dynamic-component-wrapper</code> that can instantiate any <code>Component</code> class that is passed into it.</p>
  
  <pre><code>// DRE013 DCOOKE 16/05/2017 - The component to instantiate.
  @Input() componentType: Type&lt;{}&gt;;
  
  // DRE013 DCOOKE 16/05/2017 - the component that will be created
  private _cmpRef: ComponentRef&lt;Component&gt;;
  
  
  // DRE013 DCOOKE 16/05/2017 - Creates a component ref in the view at #target
  createComponent(){
  
      let factory = this.componentFactoryResolver.resolveComponentFactory(this.componentType);
      this._cmpRef = this.target.createComponent(factory);
      //this._cmpRef.instance.inputs &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; this is a string[] and I do not see how I can use this 
  }
  </code></pre>
  
  <p>Example usage</p>
  
  <pre><code>&lt;shared-dynamic-component [componentType]="TestComponent"&gt;&lt;/shared-dynamic-component&gt;
  </code></pre>
  
  <p>Where
  <code>TestComponent = TestComponent //class</code></p>
  
  <p>This works as expected, and I can receive an instance of this component from within the <code>dynamic-component-wrapper</code> like so:</p>
  
  <p><code>this._cmpRef.instance</code></p>
  
  <p>The <a href="https://angular.io/docs/ts/latest/api/core/index/ComponentRef-class.html#!#instance-anchor" rel="nofollow noreferrer">Angular docs</a> are not clear on this <code>instance</code> object - simply stating that instance is of type <code>C</code> - with absolutely no reference to what C actually is.</p>
  
  <p>Thankfully my IDE was able to tell me that :</p>
  
  <p><code>ComponentRef.instance</code> has the following properties:</p>
  
  <ul>
  <li><code>inputs : string[]</code></li>
  <li><code>outputs : string[]</code></li>
  </ul>
  
  <p>However I do not understand how I am meant to use this information. I'd imagine this is just the <strong>names</strong> of the <code>@Input</code> fields - but I cannot think how I can pass in a complex object as an Input.</p>
  
  <h2>Question</h2>
  
  <p>Is it possible for me to set the <code>@Inputs</code> and other <strong>meta-data</strong> after dynamically creating a component with the <code>componentFactoryResolver</code>?</p>