angular-timer
angular-timer copied to clipboard
Missing $scope reference?
` $scope.reset = function () {
$scope.startTime = $scope.startTimeAttr ? moment($scope.startTimeAttr) : moment();
$scope.endTime = $scope.endTimeAttr ? moment($scope.endTimeAttr) : null;
$scope.countdown = angular.isNumber($scope.countdownattr) &&
parseInt($scope.countdownattr, 10) > 0 ? parseInt($scope.countdownattr, 10) : undefined;
resetTimeout();
tick();
$scope.isRunning = false;
$scope.clear();
$scope.$emit('timer-reset', {
timeoutId: timeoutId, // <------------- right here
millis: $scope.millis,
seconds: $scope.seconds,
minutes: $scope.minutes,
hours: $scope.hours,
days: $scope.days
});
};
`
Basically, this piece of code blows up any time it gets called. It seems it simply is missing $scope so it would look like this:
timeoutId: $scope.timeoutId
The timer seems to work anyway which is a bit curious though...