0

I want to start timer when user click on recordLogs method and reset timer when user click on stopLogs method. According to angular-timer documentation we can use timer-stop and timer-clear method to achieve these task but i am getting error start and clear undefined on timer when i invoked them from controller. Any idea ?

main.html

 <div class="col-md-3">
           <timer interval="1000">{{hours}} hour{{hoursS}}, {{minutes}} minute{{minutesS}}, {{seconds}} second{{secondsS}}.</timer>
 </div>

Ctrl.js

$scope.stopLogs = function() {
    $scope.timer-clear();

};

$scope.recordLogs = function() {
    $scope.timer-start();
}
hussain
  • 6,587
  • 18
  • 79
  • 152

1 Answers1

1

Check out examples from here : https://siddii.github.io/angular-timer/examples.html#/angularjs-single-timer-source

Younis Ar M
  • 913
  • 6
  • 15
  • Thanks for sharing example, I got it we have to $broadcast events start and clear. Thanks again! – hussain Aug 22 '16 at 21:00