-1

I Need the list to be sorted in ascending order by Name before rendering it. Guys if you know how to sort from database( MS sql server 2012) Please tell me

employe.component.html:

<tr *ngFor="let employee of employeeService.employeeList">
<td>{{employee.Name}}</td>
<td>{{employee.DOB}}</td>
<td>{{employee.Salary}}</td>
<td>
<a class="btn" (click)="showForEdit(employee)">
<i class="fa fa-pencil-square-o"></i>
</a>
<a class="btn text-danger" (click)="onDelete(employee.EmployeeId)">
<i class="fa fa-trash-o"></i>
</a>
</td>
</tr>
mohamed ismail
  • 53
  • 1
  • 2
  • 7

1 Answers1

0

If you want the dirty way, please refer to the third response in the link. But in Angular Docs it's mentionned that these type of pipes can reduce performance. Personally i do sorting from the data base it's much better

BELLIL
  • 739
  • 10
  • 23