I have 2 input element as follows in my HTML:
<input type="date" ng-model="calendarStart" class="form-control" style="display: inline-block; width: 180px !important;" />
<input type="date" ng-model="calendarEnd" class="form-control" style="display: inline-block; width: 180px !important;" />
and have .js :
$scope.calendarStart = new Date();
$scope.calendarEnd = new Date();
$scope.calendarEnd.setDate($scope.calendarEnd.getDate() + 7);
var firstEndDate = new Date();
var firstStartDate = new Date();
var startData = "calendarStart";
var endData = "calendarEnd";
$scope.changeCalendarStart = function () {
dataService.settings_get(startData).then(function(response) {
firstStartDate = response;
if (firstStartDate != null)
$scope.calendarStart = firstStartDate;
return firstStartDate;
});
return firstStartDate;
};
How I can get response value from .then function , caz need to change value in inputs ?