I can do a console log and get company. It has _id as an object property.
$scope.add2 = function () {
if (!$scope.company2) $scope.company2 = [];
var company2 = new Companies({
name: 'FestivalSauce',
store: 'DePereYo',
});
company2.$save(function (response) {
$scope.company2.push(response);
});
console.log(company2);
};
This is what I get in console
Resource {name: "FestivalSauce", store: "DePereYo", toJSON: function, $get: function, $save: function…}
$promise: undefined
$resolved: true
__v: 0
_id: "5462f632b85133000023c1ba"
name: "FestivalSauce"
store: Array[1]
__proto__: Resource
If I change console.log(company2._id) I get 'undefined' in console. Doesn't make sense.
Update: Here's the proto https://i.stack.imgur.com/D4aof.png