Angular 2 TypeScript functions with return value and binding it to HTML
<p>I am a beginner with Angular and TypeScript and I have a function like</p>

<pre><code>jajal(varname:string) {
  switch (varname) {
    case "foo":
      varname = "foo-return"
      break;
    case "bar":
      varname = "bar-return"
      break;
    case "ok":
      varname = "ok-return"
      break;    

    default:
      varname="not processed"
      break;
}
</code></pre>

<p>and the HTML template like</p>

<pre><code>&lt;ion-item button class="item item-icon-left item-icon-right" *ngFor="let user of users"&gt;
  &lt;p&gt;jajal({{user.icon}})&lt;/p&gt;
  &lt;h2&gt;{{user.icon}}&lt;/h2&gt;
  &lt;ion-icon name="arrow-forward" item-right&gt;&lt;/ion-icon&gt;
&lt;/ion-item&gt;
</code></pre>

<p>(this is an Ionic project).</p>

<p>I just wanna sent the user.icon value from HTML (p element) template to the <code>jajal()</code> function and get return value but it doesn't work.</p>