I use ng-repeat below :
<div ng-repeat="quote in quotes">
{{quote.value}}
</div>
to iterate over a quotes variable :
app.controller("MainController", function($scope){
$scope.quotes = [
{
value: "q1"
},
{
value: "q2"
},
];
});
I would like to select just one random element from this quotes variable instead of iterating over the entire array. Is there a directive in angualrjs I can use to achieve this ?