I encountered an issue while trying to call a function from app.js
in the datepicker.js
file when a button is clicked. The error message "Uncaught Reference: submitDetails is not defined" is displayed.
This error indicates that the function submitDetails is not recognized.
app.js
clickApply: function(e) {
console.log("hi&hello");
submitDetails();
this.hide();
this.element.trigger('apply.daterangepicker', this);
}
datepicker.js
$scope.submitDetails=function(){
var k= $scope.timeRangeValue;
console.log('In K', k);
k= k.split("-");
console.log('sec k', k);
k[0]= k[0].split("/").join("-");
console.log(k[0]);
k[1]= k[1].split("/").join("-");
console.log(k[1]);
var s1 = k[0].split(" ");
var s2 = k[1].split(" ");
$scope.final1 = s1[0] + "T" + s1[1] + "Z"
$scope.final2 = s2[1] + "T" + s2[2] + "Z"
console.log($scope.final1);
console.log($scope.final2);
$scope.requestDataFrEvents();
}