I'm currently trying to get a basic RESTful service up that pulls my JSON objects from MongoLab rather than the file-based implementation which I had working in my sandbox. Each of my JSON objects contain a child array (their predecessor IDs):
{title: 'xxyy1', course_id: '10004', semester_hours: 3, detail: 'coursename1', predecessors: ['10001']},
{title: 'xxyy2', course_id: '10005', semester_hours: 3, detail: 'coursename2', predecessors: ['10001','10003','10004']},
{title: 'xxyy3', course_id: '10006', semester_hours: 3, detail: 'coursename3', predecessors: ['10001','10003','10004']},
{title: 'xxyy4', course_id: '10007', semester_hours: 3, detail: 'coursename4', predecessors: ['10004','10006']}
This works perfectly fine when stringing this up into angularJS, by simply pulling the course.title, course.course_id, etc. into an ng-repeat. Even the predecessors easily is managed by constructing it as direct JSON.
<span class="predecessors">{{course.predecessors | json}}</span>
However, when trying to pull this same dataset from MongoLab using Restangular as my resource provider, I'm unable to see any data responded in the view... actually, I cannot see any data anywhere. Using Chrome's dev tools, all I see is the following:
![Restangular Response]: http://imgur.com/w8qE96K.jpg
Am I missing something here? My Mongo implementation is as follows:
RestangularProvider.setRestangularFields({
id: 'course_id'
});
RestangularProvider.setListTypeIsArray(false);
RestangularProvider.setResponseExtractor(function(response, operation, what, url) {
var newResponse;
if (operation === "getList" && what === "availableCourses") {
console.log(response);
newResponse = response.data.title;
newResponse.course_id = response.data.course_id;
newResponse.semester_hours = response.data.semester_hours;
newResponse.detail = response.data.detail;
newResponse.predecessors = response.data.predecessors;
} else {
newResponse = response.data;
}
return newResponse;
});