返回链式的承诺,这是取消 参见:http://jsbin.com/jeweke/2/
timer = $interval(intervalFunc, intervalDelay, 10);
timer.then(
function(res) {console.log('ok', res);},
function(err) {console.log('err', err);}
);
但是,如果我链中的承诺,返回的承诺是不可取消。 请参阅:http://jsbin.com/jeweke/1/
timer = $interval(intervalFunc, intervalDelay, 10)
.then(
function(res) {console.log('ok', res);},
function(err) {console.log('err', err);}
);
是怎么回事?这是它应该如何工作?
注 - 这里的例子是松散改编自http://jsfiddle.net/ExpertSystem/fZc3W/
很好的解释。感谢您挖掘源代码。 – RoyM 2014-10-21 22:52:39
@roymath不客气...... :) – PSL 2014-10-21 22:53:32