I was having problem when trying to sort the dropdown values in Angular Typescript. I am trying to sort by staffName:
<div class="row">
<div class="form-group col-md-2">
<strong><label class="form-control-label" jhiTranslate="staff.staffReportingOfficer" for="field_staffReportingOfficer">Staff Reporting Officer</label></strong>
</div>
<div class="form-group col-md-4">
<select class="form-control" id="field_staffReportingOfficer" name="staffReportingOfficer" [(ngModel)]="staff.staffReportingOfficer" (change)="roDropdownOnChange()">
<option [ngValue]='' disabled>Please select an Option</option>
<option [ngValue]="reportingOfficerOption.id === staff.reportingOfficer?.id ? staff.reportingOfficer.staffName : reportingOfficerOption.staffName" *ngFor="let reportingOfficerOption of reportingOfficers | orderBy: 'staffName'">{{reportingOfficerOption.staffName}}</option>
</select>
</div>
</div>
My staffs array contains data like A, B, C, D, E, aaaa. Then it is showing the exact same sequence as above.
My desired output will be like A, aaaa, B, C, D, E. Any ideas?