I am using Contentful in my AngularJS app... I have a content type team which holds a list of team bios. http://uat.traverusglobal.com (bottom)
I have successfully gotten data from contentful using angular-contentful... Now I need to to sort the response by name or other contentful field. So that the admin has control over the order.
How can I sort the contentful response on the frontend of my angular app? Below is my attempt.
https://jsfiddle.net/k3jmq2gm/1/
<div class="columns teams-list" contentful-entries="'content_type=staff'" ng-controller="teamContentful">
<div ng-repeat="item in $contentfulEntries.items | orderBy:'item.fields.name'" class="column" data-flag="{{item.fields.flag}}" data-visible="{{item.fields.visible}}" ng-class='{active:$first}' data-tab="1" data-title="{{item.fields.title}}" data-name="{{item.fields.name}}">
<!-- <h1>{{item[0].title}}</h1> -->
<img src="{{ item.fields.image.fields.file.url }}" title="{{item.img}}">
<p class="hide bio">{{item.fields.bio}}</p>
</div>
</div>
as Und3rTow pointed out.
orderByshould beorderBy:'fields.name'