angular-timer icon indicating copy to clipboard operation
angular-timer copied to clipboard

addCDSeconds does not work

Open pacu opened this issue 9 years ago • 0 comments

the addCDSeconds method for this directive does not work. When I try to access it directly through js the function does not exist note that there is no addCDSeconds on the timer object screen shot 2016-12-02 at 9 04 03 pm

This is how I declare the timer directive on the html file <timer autostart="false" interval="1000" finish-callback="timeUp()" countdown="countdown">{{mminutes}}:{{sseconds}}</timer>

on controller: Tried With js call:

var timer =  document.getElementById('timer-section').getElementsByTagName('timer')[0];
            timer.addCDSeconds(-halfRemainingSeconds);

and I get the following stack trace

angular.js:12520 TypeError: timer.addCDSeconds is not a function
    at Scope.$scope.bail (photoLocationExerciseGame.controller.js:66)
    at fn (eval at compile (angular.js:1), <anonymous>:4:428)
    at callback (angular.js:23613)
    at Scope.$eval (angular.js:16052)
    at Scope.$apply (angular.js:16152)
    at HTMLButtonElement.<anonymous> (angular.js:23618)
    at HTMLButtonElement.dispatch (jquery.js:4435)
    at HTMLButtonElement.elemData.handle (jquery.js:4121)

Tried with event based call $scope.$broadcast('timer-add-cd-seconds', halfRemainingSeconds);

and nothing happens

other events like timer-start and timer-stop do work.

The Examples do work on the same browser. note the addCDSeconds function there image

pacu avatar Dec 02 '16 23:12 pacu