exports.install = function(framework) {
framework.route('/', json_car_query);
};
function json_car_query() {
var self = this;
var Car = MODEL('car').Schema;
Car.find({}, {_id:0, brand:1}, function(err, docs){
if(err){
self.view500(err);
return;
}
self.json(docs, true)
});
}
function HomeCtrl($scope, Car){
$scope.brands = Car.query();
}