Filtered table corresponding to someone work ID


This Content is from Stack Overflow. Question asked by fff

I am having difficulty using my existing table to create a table with a list of courses that correspond to a specific team ID from a json file.
The format of the json is along these lines

{"courseAssociations":[{"ID":"12","StudentID":"34","CourseID":"Team234"} ,{"ID":"22","StudentID":"43","CourseID":"Team226"}

    //retrieve student course association from server
        .then(function successCall(response) {
          $scope.courseAssociations =;
        }, function errorCall() {});
      filterCourses = function() {
        $scope.filteredCourses = [];
        //loop through each item in the courseAssociations table
        for (var i = 0; i < $scope.courseAssociations.length; i++) {
          if ($scope.courseAssociations[i].StudentID == $scope.userID) {
  <div class="table-container">
    <h1>Course Feed</h1>
      <table class="table">
            <th>Course ID</th>
            <th>Course Name</th>
            <th>Course Overview</th>
            <th>Course Lecturer</th>
            <th>Lecture Times</th>

            <td data-label="Course ID">{{}}</td> 
            <td data-label="Course Name">{{}}</td>
            <td data-label="Course Overview">{{course.overview}}</td>
            <td data-label="Course Lecturer">{{course.Lec}}</td>
            <td data-label="Year">{{course.year}}</td>
            <td data-label="Trimester">{{course.tri}}</td>
            <td data-label="Lecture Times">{{course.time}}</td>
            <td data-label="%"><button id="myBtn">Delete</button></td></td>


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?