61
rated 0 times
[
64]
[
3]
/ answers: 1 / hits: 31498
/ 11 Years ago, mon, january 13, 2014, 12:00:00
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>
More From » angularjs