I'm using AngularJS filter to filter an array of objects inside a controller. These objects all have a quality that is a string. I want to be able to filter the array from largest to smallest. But I can't get it filter on value of the integer inside the string.
array = [{
object1 {
value = "3"
}, {
object2 {
value = "1"
}, {
object3 {
value = "22"
}]
$filter('orderBy')( array, 'value', true );
This would order the array as: object2, object3, object1. I've tried using parseInt but that doesn't work. Does anyone know the correct syntax?