Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing $scope reference? #315

Open
Scharnvirk opened this issue May 29, 2017 · 0 comments
Open

Missing $scope reference? #315

Scharnvirk opened this issue May 29, 2017 · 0 comments

Comments

@Scharnvirk
Copy link

Scharnvirk commented May 29, 2017

` $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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant