I have a $scope.product variable. In my view I have this:
<a ng-href="/{{ gender }}/{{ section }}/{{ product.slug }}">{{ product.name }}</a>
If $scope.product.vendor exists, I want it to show
{{ product.vendor.name }} - {{ product.name}} ex: VendorName - ProductName
else, just show
{{ product.name }} ex: ProductName
How would I do this in the view? Or should this be done elsewhere?
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:
<h3 ng-switch="locale">
<a ng-href="/{{ locale }}/{{ gender }}/{{ section }}/{{ product.slug }}" ng-switch-when="cn">{{ product.name }}</a>
<a ng-href="/{{ gender }}/{{ section }}/{{ product.slug }}" ng-switch-default>{{ product.name }}</a>
</h3>