I want to sort data from my method in ascending and descending order. this is my method.
public get students(): Student[] {
return this._dashboardService.account.students;
}
This is my component.html code
<li *ngFor="let stud of students">
<div class="{{stud == selectedStudent && highlightStudent ? 'hoveffect' : ''}}">
<div class="hovlink">
<a (click)="setStudent(stud)">
<img [src]="stud.imageUrl ? getStudentFaceImage(stud.imageUrl) : tempDpImage" />
<!--<span>{{stud.firstName}}</span>-->
</a>
</div>
<h4>{{stud.schoolId}}</h4>
</div>
</li>
Kindly help me if you know a solution to it.
this is student class.
export class Student {
public userID: number;
public firstName: string;
public lastName: string;
public schoolId: number;
public schoolName: string;
public classId: number;
public className: string;
public sectionId: number;
public sectionName: string;
public currencyCode: string;
public favImageWithoutCorselCount: number;
public NonfavImageWithoutCorselCount: number;
public photos: listData<any>;
public products: listData<any>;
public packages: listData<any>;
public orders: any;
public downloads: listData<any>;
public offers: listData<any>;
public cart: any;
public supportDetail: SupportDetail;
public timeStamp: any;
public isSibling: number;
public EventName: string;
public QrCode: string;
}