title: How would I conditionally interpolate a string in my HTML file with AngularJS?
body: <p>I have a <code>$scope.product</code> variable. In my view I have this:</p>
  
  <pre><code>&lt;a ng-href="/{{ gender }}/{{ section }}/{{ product.slug }}"&gt;{{ product.name }}&lt;/a&gt;
  </code></pre>
  
  <p>If <code>$scope.product.vendor</code> exists, I want it to show </p>
  
  <p><code>{{ product.vendor.name }} - {{ product.name}}</code> ex: VendorName - ProductName</p>
  
  <p>else, just show</p>
  
  <p><code>{{ product.name }}</code> ex: ProductName</p>
  
  <p>How would I do this in the view? Or should this be done elsewhere?</p>
  
  <p>P.S. that was a simplified version of my HTML. I already have a switch statement for another variable for the surrounding div, so this is what it actually looks like:</p>
  
  <pre><code>  &lt;h3 ng-switch="locale"&gt;
      &lt;a ng-href="/{{ locale }}/{{ gender }}/{{ section }}/{{ product.slug }}" ng-switch-when="cn"&gt;{{ product.name }}&lt;/a&gt;
      &lt;a ng-href="/{{ gender }}/{{ section }}/{{ product.slug }}" ng-switch-default&gt;{{ product.name }}&lt;/a&gt;
    &lt;/h3&gt;
  </code></pre>