fix for correct alphabetical in subjects array
This commit is contained in:
parent
cd7a6722ac
commit
e4e79ff31c
|
@ -1 +1 @@
|
||||||
Subproject commit db5c95fe248c0e4fe059602185ee8a6161d9949f
|
Subproject commit ad15aaae31acab823f624a64410f33c31d8526f7
|
|
@ -148,8 +148,17 @@ export class SubjectsComponent {
|
||||||
//this.getDivContents();
|
//this.getDivContents();
|
||||||
this.getPageContents();
|
this.getPageContents();
|
||||||
this.subjects = community.subjects;
|
this.subjects = community.subjects;
|
||||||
this.subjects.sort();
|
console.log(this.subjects);
|
||||||
|
this.subjects.sort((a,b) => {
|
||||||
|
if(!a || a.toLocaleUpperCase() < b.toLocaleUpperCase()) {
|
||||||
|
return -1;
|
||||||
|
} else if (!b || a.toLocaleUpperCase() > b.toLocaleUpperCase()) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
this.groupSubjects();
|
this.groupSubjects();
|
||||||
|
console.log(this.subjects);
|
||||||
this.showLoading = false;
|
this.showLoading = false;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
@ -179,6 +188,10 @@ export class SubjectsComponent {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// private sortSubjects(a, b) {
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
private groupSubjects() {
|
private groupSubjects() {
|
||||||
if(this.subjects.length === 0) {
|
if(this.subjects.length === 0) {
|
||||||
return [];
|
return [];
|
||||||
|
|
Loading…
Reference in New Issue