title: Set id in angular2 component
body: <p>I've created an angular2 component to host a Label together with input and validation messages. The template Looks like this:</p>
  
  <pre><code>&lt;div class="form-group" [ngClass]="{'has-error':!formcontrol.valid &amp;&amp; formcontrol.touched}"&gt;
      &lt;label class="col-sm-2 control-label" &gt;{{label}}&lt;/label&gt;
      &lt;div class="col-sm-6"&gt;
          &lt;input class="form-control" type="text" [formControl]="formcontrol"&gt;
          &lt;div *ngIf="formcontrol.hasError('required') &amp;&amp; formcontrol.touched" class="alert alert-danger"&gt;muss ausgefüllt werden.&lt;/div&gt;
          &lt;div *ngIf="formcontrol.hasError('minlength') &amp;&amp; formcontrol.touched" class="alert alert-danger"&gt;diese Eingabe ist zu kurz.&lt;/div&gt;
          &lt;div *ngIf="formcontrol.hasError('maxlength') &amp;&amp; formcontrol.touched" class="alert alert-danger"&gt;diese Eingabe ist zu lang.&lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My component.ts:</p>
  
  <pre><code>import { Component, Input } from "@angular/core";
  
  @Component({
      selector: "bs-ctrl-string",
      template: require("./bs-ctrl-string.component.html"),
  })
  export class BsCtrlStringComponent {
      @Input() label: string;
      @Input() formcontrol: any   
  }
  </code></pre>
  
  <p>I use this component from other components like this:</p>
  
  <pre><code>&lt;bs-ctrl-string [label]="'first name'" [formcontrol]="form.controls['firstname']"&gt;&lt;/bs-ctrl-string&gt;
  &lt;bs-ctrl-string [label]="'last name'" [formcontrol]="form.controls['lastname']"&gt;&lt;/bs-ctrl-string&gt;
  </code></pre>
  
  <p>My problem is: For end-to-end-tests I need to access the Input:</p>
  
  <pre><code>browser.FindElement(By.Id("firstname")).SendKeys("Sam");
  </code></pre>
  
  <p>Problem is: how do I set the id of the input field in my component from the hosting component? It would need to be something like this:</p>
  
  <pre><code>&lt;bs-ctrl-string inputid="firstname" [label]="'first name'" [formcontrol]="form.controls['firstname']"&gt;&lt;/bs-ctrl-string&gt;
  &lt;bs-ctrl-string inputid="lastname" [label]="'last name'" [formcontrol]="form.controls['lastname']"&gt;&lt;/bs-ctrl-string&gt;
  </code></pre>