title: How to declare a variable for only using in template in Angular2
body: <p>I have below code</p>
  
  <pre><code>  &lt;ion-card &gt;
      &lt;ion-card-content&gt;
        &lt;ion-chip *ngFor="let skill of contact.skills | split"&gt;
          &lt;ion-label&gt;{{skill}}&lt;/ion-label&gt;
        &lt;/ion-chip&gt;
      &lt;/ion-card-content&gt;
    &lt;/ion-card&gt;
  </code></pre>
  
  <p>then I want to hide the card if there is no skills, so I changed it to</p>
  
  <pre><code>  &lt;ion-card [hidden]="(contact.skills | split).length == 0"&gt;
      &lt;ion-card-content&gt;
        &lt;ion-chip *ngFor="let skill of contact.skills | split"&gt;
          &lt;ion-label&gt;{{skill}}&lt;/ion-label&gt;
        &lt;/ion-chip&gt;
      &lt;/ion-card-content&gt;
    &lt;/ion-card&gt;
  </code></pre>
  
  <p>and it's working fine, but the problem is value is going to split pipe twice, then how can I define a variable and using pipe once?</p>
  
  <p>I tried below but not working </p>
  
  <pre><code>  &lt;ion-card #skills="contact.skills | split" [hidden]="skills.length == 0"&gt;
      &lt;ion-card-content&gt;
        &lt;ion-chip *ngFor="let skill of skills"&gt;
          &lt;ion-label&gt;{{skill}}&lt;/ion-label&gt;
        &lt;/ion-chip&gt;
      &lt;/ion-card-content&gt;
    &lt;/ion-card&gt;
  </code></pre>