警报复位-密码response.html:
<span data-ng-bind="responseInfo"></span>
JS:
$scope.language.resetPassword.responseInfo = 'Redirecting in {{responseTime}} seconds.';
$scope.responseTime = 3;
$scope.responseInfo = $interpolate($scope.language.resetPassword.responseInfo)($scope);
angular.element(document.getElementsByClassName('alert-container')[0]).append($compile($templateCache.get('alert-reset-password-response.html'))($scope));
setInterval(function () {
$scope.responseTime = $scope.responseTime - 1;
$scope.$apply();
console.log($scope.responseTime); // <-- this displays the count down correct in the console (2, 1, 0...)
if ($scope.responseTime === 0)
$window.location.href = '/';
}, 1000);
我感觉我没有正确绑定{{responseTime}}
,它只是位于3
的初始数字(意味着{{responseTime}}
没有绑定)。