I'm trying to make the sort functionality work by creating two buttons: relevance and date.
I've set it up the following way:
<div ng-init="sort=false">
<a ng-click="sort=true">Date</a>
<a ng-click="sort=false">Relevance</a>
then on the container with the results:
<div eui-sort="ejs.Sort('post_date').order('desc')" eui-enabled="sort" >
The value set with ng-init
properly affects the initial sort order and when I click date
the list sorts as intended, but when I click relevance
the list does not re-sort back as if eui-enabled
was set to false
.
I'm guessing underformed knowledge of Angular is causing me to oversimplify this. Any advice?