为什么它不工作,设置$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;
};
setTimeout
没有摘要。请改用角度$timeout
服务。
app.controller('MainCtrl', function($scope, $timeout) {
$scope.bluryLines = function(value) {
$scope.blured = true;
//faking a post
$timeout(function() {
$scope.blured = false;
}, 1000);
};
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句