siddii / angular-timer

re-usable/inter-operable AngularJS timer directive ⛺
http://siddii.github.io/angular-timer/
MIT License
792 stars 938 forks source link

Timer not working #221

Open zeeshanjan82 opened 9 years ago

zeeshanjan82 commented 9 years ago

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 commented 9 years ago

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

Hesesses commented 9 years ago

+1

diegodfsd commented 8 years ago

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;
    }
louishawkins commented 8 years ago

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