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

Timer not working

Open zeeshanjan82 opened this issue 9 years ago • 4 comments

For me the timer is not working, I am using Controller As syntax and I do not see the timer working even what I have imported the angular-timer module along with humanize-duration. The hours, minutes and seconds are not even rendered. Is there any special consideration for using Controller As syntax?

zeeshanjan82 avatar Oct 26 '15 11:10 zeeshanjan82

After analyzing I found that the reason is this error

humanizeDuration is not defined

However I have installed it and referenced it . I am using system.js and jspm

zeeshanjan82 avatar Oct 26 '15 12:10 zeeshanjan82

+1

Hesesses avatar Oct 27 '15 16:10 Hesesses

Well, I'm using controllerAs and the timer render right, but when I trying to set countdown attribute with a variable then the timer is not rendered.`

<timer interval="1000" countdown="timeLimit">{{countdown}} segundos</timer>
.config(function($stateProvider) {
            $stateProvider.state('state.name', {
                url: '/{id:[0-9]+}/preview',
                views: {
                    "form": {
                        controller: 'previewCtrl',
                        templateUrl: 'template-path.tpl.html',
                        controllerAs: 'vm'
                    }
                }
            });
        })
        .controller('previewCtrl', PreviewCtrl);

    function PreviewCtrl() {
        /* jshint validthis: true */
        var vm = this;

        vm.timeLimit = 20;
    }

diegodfsd avatar Nov 21 '15 02:11 diegodfsd

According to the readme the module humanize-duration is required. https://github.com/EvanHahn/HumanizeDuration.js

louishawkins avatar Mar 11 '16 05:03 louishawkins