为什么在$scope.blured
中设置setTimeout()
(模拟帖子和回复)不起作用?
$scope.bluryLines = function(value) {
$scope.blured = true;
if (value === '' || value === undefined) {
console.log('value is empty');
} else {
console.log(value);
}
//faking a post
setTimeout(function() {
$scope.blured = false;
console.log('log');
}, 1000);
};
按下按钮立即清除它。
$scope.removeOverlay = function() {
$scope.blured = false;
};
答案 0 :(得分:2)
<div class ='article'>
<span class='author'> John doe</span> <h3>title</h3>
(...)
<div class='comments'>
<div class='row'>
<span class='author'>Whining anon</span>
<div class='content'>
(...)
</div>
</div>
</div>
</div>
没有运行摘要。请改用角度$timeout
服务。
setTimeout