After successfully implementing a calendar and capturing the specified days upon click, I encountered an issue with the variable $scope.dateKey. Here is a snippet from Calender.js:
$scope.checkDate = function(key){
$scope.dateKey = key - 1;
alert("left")
alert($scope.dateKey)
if ($scope.dateKey>=1){
alert("Testing")
}
if(dateKey == 0) {
$rootScope.loadNextDay = true;
alert("right")
}
};
The variable $scope.dateKey holds values ranging from 0 to 6 depending on the selected day. Now, I am attempting to utilize this variable in another JavaScript file (a new one). Here is a snippet from application.js:
if($scope.currentDate = true && shift==0)
{
alert("Hey.....")
alert($scope.dateKey)
}
else{
alert("Testing123")
$scope.moveTo(0);
$scope.currentDate = false;
$timeElapsed.hide();
params.starthour = 0;
}
However, when trying to access $scope.dateKey in application.js, it returns as undefined. How can I resolve this issue and successfully use the value of dateKey from calender.js in application.js?