i have a json get request whose response comes back as:
but if i use $http or restangular and console log the response or put the result on the screen, the property Options are undefined though i can see it in firebug. but if i use jquery.get() the property Options are populated correctly. i tried renaming the Options property but that didn't work either. this is vanilla restangular -- nothing special in the config. does anyone know whats going on?
here's the code:
// this works
$.get('/api/dynamicproducts/5501f37b97c92c53d8eb54e7', function(data) {
console.log(data);
});
// this doesn't
vm.product = restangular.one("dynamicproducts", '5501f37b97c92c53d8eb54e7').get().$object;
// this doesn't
$http.get('/api/dynamicproducts/5501f37b97c92c53d8eb54e7').success(function(data) {
console.log(data);
});
{
"ProductName": "Online Form",
"ProductProperties": [{
"PropertyName": "Status",
"Options": [{
"Selected": false,
"Text": "Status1",
"Value": "1"
}, {
"Selected": false,
"Text": "Status2",
"Value": "2"
}, {
"Selected": false,
"Text": "Status3",
"Value": "3"
}]
}, {
"PropertyName": "Publication",
"Options": [{
"Selected": false,
"Text": "Publication1",
"Value": "1"
}, {
"Selected": false,
"Text": "Publication3",
"Value": "3"
}]
}]
}