I have the following json "files", I'm only interested in counting the typedescrip to make a list with them to know how many types I have
I'm using angular to build my functions
suggestions are accepted
{
"archivos": [
{
"nombre": "eir 2018, 1799.pdf",
"id": "1595146",
"path": "http://4chan.org//1bd4c703-08f4-470a-80b6-0f48d0c5a547.pdf",
"mime": "pdf.png",
"tipodescrip": "COVE"
},
{
"nombre": "SIM38434308002358.pdf",
"id": "1585738",
"path": "http://4chan.org//1bd4c703-08f4-470a-80b6-0f48d0c5a547.pdf",
"mime": "pdf.png",
"tipodescrip": "Pedimento"
},
{
"nombre": "ORD38434308002358.pdf",
"id": "1585739",
"path": "http://4chan.org//1bd4c703-08f4-470a-80b6-0f48d0c5a547.pdf",
"mime": "pdf.png",
"tipodescrip": "Pedimento Aduanal"
},
{
"nombre": "h3412724.pdf",
"id": "1591453",
"path": "http://4chan.org//1bd4c703-08f4-470a-80b6-0f48d0c5a547.pdf",
"mime": "pdf.png",
"tipodescrip": "Facturas de Gastos (A cuenta de Terceros)"
},
{
"nombre": "h3412724.xml",
"id": "1591454",
"path": "http://4chan.org//1bd4c703-08f4-470a-80b6-0f48d0c5a547.pdf",
"mime": "xml2.png",
"tipodescrip": "Facturas de Gastos (A cuenta de Terceros)"
},
{
"nombre": "20180427145021682O.xml",
"id": "1572837",
"path": "http://4chan.org//1bd4c703-08f4-470a-80b6-0f48d0c5a547.xml",
"mime": "xml2.png",
"tipodescrip": "COVE"
}
]
}
So I get the files
var oficina = localStorage.getItem("numoficina");
var vgget = globales[urlgetarchivos][oficina];
$http({
url: vgget,
method: "POST",
data: {
referencia: ref
},
headers: {
'Content-Type': 'application/json; charset=utf-8',
'dataType': 'json'
}
})
.success(function (response) {
console.log(response.archivos);
var r = response.archivos;
console.log(r);
$scope.itemsarchivo = r;
}).catch(function (error) {
console.log(error);
//alert("Error: " + error);
});
I would like to create one to put inside the name of the file type and inside the path of the file to consult it
I appreciate the support