title: Angular: HostBinding to custom component property
body: <p>I'm trying to bind to a property on a parent component from a child component but it's not working.  Here's the code:</p>
  
  <p><strong>Parent</strong></p>
  
  <p><code>myProp: string;</code>  (I've also tried <code>@Input() myProp: string;</code>)</p>
  
  <p><strong>Child</strong></p>
  
  <p><code>@HostBinding('myProp')  prop1: string;</code></p>
  
  <p>The error I'm getting is <strong><em>Can't bind to 'myProp' since it isn't a known property of 'child-component'</em></strong> which makes sense, because isn't the idea behind HostBinding that it should look for the property on the <strong>parent</strong>, not the child?</p>
  
  <p>I've seen lots of examples of binding to <code>class</code>, <code>style</code> and <em>attributes</em> on the parent/host, but nothing for custom properties, other than mentions that it is possible.  The Angular docs also state <a href="https://github.com/angular/angular/blob/c2dbc55f115eb259a6d90e2b45ed61c329258c22/packages/core/src/metadata/directives.ts#L949" rel="nofollow noreferrer"><code>HostBinding</code> takes an optional parameter that specifies the property name of the host element that will be updated.</a></p>
  
  <p>Does anyone have an example they can share of this working?</p>
  
  <p>Thanks.</p>