0

I am developing an ionic application which will be able to be used as a timetable-like application. I am trying to pull in data using this line of code in an ng-repeat

<ion-item ng-show="item.Location" ng-repeat="item in test | filter: {Day: 'Fri'}>
<table style="width:100%">
<tr>
        <td>
        Course
        </td>
        <td>{{item.Course}}</td>
 </tr>
 <tr>
        <td>
         Tutor
        </td>
        <td>{{item.Staff_Name}}</td>
 </tr>
 <tr>
        <td>
        Campus
        </td>
        <td>{{item.Campus}}</td>
  </tr>
</table>
</ion-item>

Is there anyway in which I can use a this code and remove a record if all columns of that record match? Meaning that if the record has an exact duplicate, it will only display one?

Any help would be gratefully appreciated.

  • Possible duplicate of [How to make ng-repeat filter out duplicate results](http://stackoverflow.com/questions/15914658/how-to-make-ng-repeat-filter-out-duplicate-results) – mitkosoft Apr 08 '16 at 11:11
  • show us your $scope.test... data – Thalaivar Apr 08 '16 at 11:13
  • @Thalaivar the $scope.test is just a timetable from a student, but some have came through as duplicates, they cannot be unique by only one record, they will be to be duplicates within all columns. – Caolán McKeown Apr 08 '16 at 11:18
  • Can you create a mock data of the same... – Thalaivar Apr 08 '16 at 11:19
  • @Thalaivar StudentID, Course, Module, Activity_Start_Time, Activity_EndTime, Activity_Date, Activity_Type, Day, Campus, Location, Staff_Name, Timetabled_Hours. Above are the list of fields which will be saved under each lesson a student will have – Caolán McKeown Apr 08 '16 at 11:21
  • You should be using the `unique` modifier to the filter. It's pretty simple to implement: http://jsfiddle.net/n7zcg/ – Evan Bechtol Apr 08 '16 at 11:27
  • How do I use the unique modifier to check all fields? – Caolán McKeown Apr 08 '16 at 11:32
  • Hm, in that case you may have to make your own filter to perform that task and return the results – Evan Bechtol Apr 08 '16 at 11:44

0 Answers0