【发布时间】:2015-12-18 17:36:24
【问题描述】:
$scope.runTest = function() {
var statesArray = ['Running', 'Complete', 'Rejected'];
var rand = statesArray[Math.floor(Math.random() * statesArray.length)];
item.state = 'Running';
console.log(rand)
window.setTimeout(function() {
item.state = rand;
}, 6000);
};
item 状态更改为Running 成功,但之后状态不会更改为window.setTimeout 函数中所述的随机状态。
我哪里错了?
【问题讨论】:
标签: javascript angularjs