title: Angular 2: Component Interaction, optional input parameters
body: <p>I have an implementation where parent wants to pass certain data to child component via the use of <code>@Input</code> parameter available at the child component. However, this data transfer is a optional thing and the parent may or may not pass it as per the requirement. Is it possible to have optional input parameters in a component. I have described a scenario below:</p>
  
  <pre><code> &lt;parent&gt;
      &lt;child [showName]="true"&gt;&lt;/child&gt; //passing parameter
      &lt;child&gt;&lt;/child&gt; //not willing to passing any parameter
  &lt;/parent&gt;
  
  
  
  //child component definition
  @Component {
      selector:'app-child',
      template:`&lt;h1&gt;Hi Children!&lt;/h1&gt;
            &lt;span *ngIf="showName"&gt;Alex!&lt;/span&gt;`
  }
  
  
  export class child {
  
      @Input showName: boolean;
  
      constructor() { }
  
  }
  </code></pre>