I have implemented a calender and on click I am getting the specified days. 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")
    }
  };
Now the value of dateKey I am getting is somewhere from 0 to 6 depending on the day selected. Now I am trying to use the variable ie $scope.dateKey in another js file(a new one). Snippet of 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;
}
But in this $scope.dateKey is giving undefined. What should I do to use the value of dateKey from calender.js to application.js?