I have similar to following working code
<section class="row-fluid result" ng-repeat="result in getResults()">
<p>{{result.name}}</p>
<p>{{result.link}}</p>
</section>
the result
have another property called resultId
where result.resultId
will return one of following source prefixes: One, Two,Three.
For example these are typical resultId: One3244243, One23036043, Two3890234, Three23114232
Whereas prefixes means:
One=Source ABC
Two=Source XYZ
Three=Source WXY
So, now I want to also display the sources of the each result based on result's id prefixes:
<section class="row-fluid result" ng-repeat="result in getResults()">
<p>{{result.name}}</p>
<p>{{result.link}}</p>
<p><!-- display 'Source ABC' if result.resultId starts with One --> </p>
<p><!-- display 'Source XYZ' if result.resultId starts with Two--> </p>
<p><!-- display 'Source WXY' if result.resultId starts with Three --> </p>
</section>
Do ng-show="result.resultId.indexOf('One') == 0"
, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With