I am trying to pass a property in my $scope to my factory. I could console.log it find, but when I try to pass it to my factory, an error occurs.
controller:
mainFactory.getHigh($scope.products[0]._id, function (bid) {
$scope.bid1 = bid;
});
factory
factory.getHigh = function (id, callback) {
$http.post('/high', id)
.then(function (response) {
callback(response)
})
}
error: $scope.products[0]._id is undefined