I have a unique JavaScript file with various functions. All the functions are functioning perfectly.
One particular function returns a list of modules. I want to replicate a specific div section in my template based on the length of this list.
This snippet shows my ionic template file:
<ion-view title="My Marks" id="page7">
<ion-content ng-controller="MyMarks" padding="true" class="has-header">
<div ng-repeat="module in getCourseModules">
<div class="row">
<div class="col">{{module}}</div>
</div>
<div class="row">
<div class="col col-50">Module Mark</div>
<div class="col col-50">{{GenerateRandomMarks[i]}}</div>
</div>
<br>
<br>
</div>
</ion-content>
Here is the controller from my app.js file:
app.controller('MyMarks', function ($scope){
$scope.courseNum = GenerateRandomNumber(0, 9);
$scope.getCourseName = getCourseName(courseNum);//Returns just Text
$scope.getCourseModules = getCourseModules(courseNum); //Returns the list
$scope.GenerateRandomMarks = GenerateRandomMarks(); //Returns a list of numbers
});
How can I dynamically repeat the desired code segment? Each repetition should display a different element from the list {{getCourseModules[i]}}.
I've managed to solve most of the issues, but I'm struggling with the repeating part. Manual copy/paste works fine.