我想在用户单击方法时启动计时器并在用户单击recordLogs方法时重置计时器stopLogs。根据角度计时器文档,我们可以使用timer-stop和timer-clear方法来完成这些任务,但是当我从控制器调用它们时,我在计时器上遇到错误start和未定义。clear任何想法 ?
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();
}