I want to use a different template within a repeated block based on the type of data that I am repeating. In my example, the array could contain data or it could contain tweet objects from Twitter. Currently my code looks like this...
<ul data-ng-hide="sourceIsTwitter()" collapse="!showStrings">
<li data-ng-repeat="matchedString in matches">{{matchedString}}</li>
</ul>
<ul data-ng-show="sourceIsTwitter()" collapse="!showStrings">
<li data-ng-repeat="tweet in matches">
{{ tweet.text }}
<i>{{ tweet.user.name }}</i>
<a href="{{ tweetUrl(tweet) }}">{{ formatDateFromTwitter(tweet.created_at) }}</a>
</li>
</ul>
... and throws lots of errors when the content source isn't Twitter. How should I restructure this to use the right template based on the type of the object? Assume that matches is an array of objects and each object has a property type that I can check.