Angular Sort Array Of Objects Based On Function