I'm new to Angular and having trouble trying to parse a JSON response from this API: http://icd10api.com/?s=C50&desc=long&r=json
in this codepen here: http://codepen.io/FritzAPI/pen/dNZWKZ
which I got working with a hardcoded modified response:
function loadVegetables() {
var veggies = [
{"Name":"C50","Description":"Malignant neoplasm of breast"},{"Name":"C50.0","Description":"Malignant neoplasm of nipple and areola"},{"Name":"C50.01","Description":"Malignant neoplasm of nipple and areola, female"},{"Name":"C50.011","Description":"Malignant neoplasm of nipple and areola, right female breast"},{"Name":"C50.012","Description":"Malignant neoplasm of nipple and areola, left female breast"},{"Name":"C50.019","Description":"Malignant neoplasm of nipple and areola, unspecified female breast"},{"Name":"C50.02","Description":"Malignant neoplasm of nipple and areola, male"},{"Name":"C50.021","Description":"Malignant neoplasm of nipple and areola, right male breast"},{"Name":"C50.022","Description":"Malignant neoplasm of nipple and areola, left male breast"},{"Name":"C50.029","Description":"Malignant neoplasm of nipple and areola, unspecified male breast"}
];
return veggies.map(function (veg) {
veg._lowername = veg.Name.toLowerCase();
veg._lowertype = veg.Description.toLowerCase();
return veg;
});
}
but as soon as the response is wrapped in a search array {"Search":[...]} this function no longer works.