Could someone please help me with creating a conditional href instead of duplicating an a tag for hide/show functionality?
Here's the issue I'm facing: if DisplayLocation is null, I want to use the string "unknown", otherwise I want to display the location. I attempted something like x ? y : "unknown" but it doesn't seem to work in the href attribute.
<a class="btn-main orange" href="#!/movie-details/
{{movie.Item.DisplayLocation | prettify}}/
{{movie.Item.Title | prettify}}/{{movie.Item.Id}}"
id="view--{{$index}}"> View
</a>
Solution:
<a class="btn-main orange" data-ng-href="#!/movie-details/
{{movie.Item.DisplayLocation ?
movie.Item.DisplayLocation : 'unknown' | prettify}}/
{{movie.Item.JobTitle | prettify}}/
{{movie.Item.Id}}"
id="view--{{$index}}">View
</a>