1
I have an Angularjs object:
$scope.listaDoCarrinho = [0: {
id: "55",
setor: "alimento",
foto: "Produtos/Produto (55).jpg",
descr: "Espaguete Renata",
de: 15,
…
}
1: {
id: "1000",
setor: "biscoitos",
foto: "Produtos/Produto (1000).jpg",
descr: "Biscoito Pit-Stop",
de: 3,
…
}
2: {
id: "3",
setor: "higiene",
foto: "Produtos/Produto (3).jpg",
descr: "Bronzeador 200ml",
de: 15,
…
}
];
I need to change this sequence by id (3 -> 55 -> 1000). There is a way to do it without ng-repeat?
Obs: the "-" (dash) in the code is only to inform that the array has more insignificant properties.
In doing so, the console says "Referenceerror: filter is not defined".
– Gymo
@Guilhermesilvadeoliveira has to import $filter, he did this?
– Sorack
No, I’ve never actually used $filter... I’ll look up how to import it.
– Gymo
I did it. To sort it in ascending order, just take the quotes from the id, right?
– Gymo
@Guilhermesilvadeoliveira exact
– Sorack