Help please connect the timer plugin on the page. I connected all the necessary libraries and added a controller to my module. An example is here . The plugin itself took from here

html:

<div ng-app="HelloUserApp"> <div ng-controller="HelloUserController"> {{qw}} </div> <div class="enter-screen-inner" ng-controller="countdownController">{{timerRunning}} <timer countdown="10041" max-time-unit="'minute'" interval="1000">{{mminutes}} minute{{minutesS}}, {{sseconds}} second{{secondsS}}</timer> <timer end-time="1475488800000" language="ru" finish-callback="timerFinished()"> <div> <div>{{days}}</div> </div> <div> <div>{{hours}}</div> </div> </timer> </div> </div> 

js:

 angular.module('HelloUserApp', []) .controller('HelloUserController', function($scope) { $scope.qw = 'qwerty'; }) .controller('countdownController', function ($scope) { $scope.timerRunning = true; $scope.timerFinished = function () { console.log('timer is finished'); }; }); 

There are no errors in the console, but the time is still not displayed on the screen. This is the problem.

    1 answer 1

    The above code does not use the plugin itself.

    To use it, depending on the main module you need to add a plug-in module:

     angular.module('HelloUserApp', ['timer']) 

    In addition, the plugin depends on momentjs, so you need to add a link to this library.

     angular.module('HelloUserApp', ['timer']) .controller('HelloUserController', function($scope) { $scope.qw = 'qwerty'; }) .controller('countdownController', function($scope) { $scope.timerRunning = true; $scope.timerFinished = function() { console.log('timer is finished'); }; }); 
     <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.15.0/moment.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-timer/1.3.4/assets/js/angular-timer-all.min.js"></script> <div ng-app="HelloUserApp"> <div ng-controller="HelloUserController"> {{qw}} </div> <div class="enter-screen-inner" ng-controller="countdownController">{{timerRunning}} <timer countdown="10041" max-time-unit="'minute'" interval="1000">{{mminutes}} minute{{minutesS}}, {{sseconds}} second{{secondsS}}</timer> <timer end-time="1475488800000" language="ru" finish-callback="timerFinished()"> <div> <div>{{days}}</div> </div> <div> <div>{{hours}}</div> </div> </timer> </div> </div>