浏览代码

deleted duplicates

rjsmall90 6 年前
父节点
当前提交
0748542bea
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5
    1
      src/providers/connection/district.ts

+ 5
- 1
src/providers/connection/district.ts 查看文件

@@ -24,7 +24,11 @@ export class DistrictProvider {
24 24
     }
25 25
 
26 26
     parseData(data: any) {
27
-        return data["data"].map(school => new School(school[13]))
27
+        return data["data"].map(school => school[13]).filter(this.onlyUnique).map(school => new School(school));
28
+    }
29
+
30
+    onlyUnique(value, index, self) { 
31
+        return self.indexOf(value) === index;
28 32
     }
29 33
 
30 34