Order a list

For something like this, I’d use a pipe to order the element.

import {Injectable, Pipe} from 'angular2/core';
import * as _ from 'lodash';

@Pipe({ name: 'order-by' })
export class OrderByPipe {
  transform(array, args) {
    return _.sortBy(array, args);
  }
}

then you could use it like

<a ion-item *ngFor="#item of items | order-by:'value'">{{item.value</a>
6 Likes