title: Should Angular2 @Inputs be public or can/should we have a stricter API by making them private?
body: <p><em>I am using Angular2 with Typescript</em></p>
  
  <p>Suppose I have the following in my app component's template: </p>
  
  <pre><code>... 
  &lt;coffee-cup [coffee]=""
  ...
  </code></pre>
  
  <p>My <code>coffee-cup</code> component: </p>
  
  <pre><code>@Component({
    selector: 'coffee-cup',
    ...
  })
  export class CoffeeCup {
  
    @Input() 
    public coffee = 0;
  
  }
  </code></pre>
  
  <p>I am currently unsure of what my Input should look like.  It could look like this: </p>
  
  <pre><code>@Input()
  public coffee = 0;
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>@Input()
  private coffee = 0;
  </code></pre>
  
  <p>I am currently leaning towards making the member variable coffee private.  </p>
  
  <ul>
  <li>I want to define a clear public API for the component </li>
  <li>I only want to expose setting the coffee property through the template  </li>
  <li>I don't presently have any reason to allow coffee to be read or set directly from the parent component.  If the need arises, I can drop the private modifier.  </li>
  </ul>
  
  <p>The way that I am viewing a component is that there are two separate APIs to interact with it: </p>
  
  <ol>
  <li>The template API, which consists of the <code>@Inputs</code> and <code>@Outputs</code></li>
  <li>The Typescript API which consists of all of the public properties and methods</li>
  </ol>
  
  <p>I haven't checked what occurs in the following situation, however, it may change the answer: </p>
  
  <ul>
  <li>Suppose the coffee member is public.  If my <code>appComponent</code> gets access to <code>CoffeeCup</code> using <code>@ViewChild</code> and sets the coffee member, will the lifecycle hooks (like <code>ngOnChange</code>) fire?</li>
  </ul>
  
  <p>To restate the question: <em>Should Angular2 <code>@Input</code>s be public or can/should we have a stricter API by making them private?</em></p>