I am getting that error when I do I post from my controller
function postDashboardsData (dataType, dateFrom, dateTo) {
$scope[dataType + '_done'] = false;
Api.post('rotations/' + vm.data[0]._id + '/dashboard', angular.extend({
type : dataType,
date_range : {
from : dateFrom,
to : dateTo
}
}, vm.data));
}
and here I call that function in the same controller
postDashboardsData('overall', $scope.datepickerConf1.overall, $scope.datepickerConf2.overall)
.then(function(data) {
console.log('data>>>', data);
$scope.overallData = data;
})
that then above is the one returning undefined
error again
TypeError: Cannot read property 'then' of undefined
what should I do?