This is my code where I get the data from a json file an put it in an array. I want to take from my array only 5 items, but I want to do that code in the app.js file, not in html file. So I don't want to use ng-repeat with limitTo.
$http.get('auto_quiz_data.json').then(function(quizData){
$scope.myQuestions = quizData.data;
$scope.totalQuestions = $scope.myQuestions.length;
shuffleArray($scope.myQuestions);
});
and this is the html
<div id="myQuiz" ng-controller="QuizController">
<p class="txt">{{totalQuestions}}</p>
</div>
Someone please tell me how to print in the view only 5 items.