本文整理汇总了TypeScript中angular2/src/facade/async.TimerWrapper.setTimeout方法的典型用法代码示例。如果您正苦于以下问题:TypeScript TimerWrapper.setTimeout方法的具体用法?TypeScript TimerWrapper.setTimeout怎么用?TypeScript TimerWrapper.setTimeout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/src/facade/async.TimerWrapper
的用法示例。
在下文中一共展示了TimerWrapper.setTimeout方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: BaseException
TimerWrapper.setTimeout(() => {
TimerWrapper.setTimeout(() => {
c.resolve(null);
throw new BaseException('ccc');
}, 0);
}, 0);
示例2:
_zone.runOutsideAngular(() => TimerWrapper.setTimeout(fn, needsLongerTimers ? timer : 1));
示例3:
_zone.runOutsideAngular(() => TimerWrapper.setTimeout(fn, isIE ? timer : 1));
示例4: macroTask
macroTask(() => {
TimerWrapper.setTimeout(() => {
expect(_log.result()).toEqual('run; onTurnDone; onEventDone; asyncTask');
async.done();
}, 50);
});
示例5:
_zone.overrideOnEventDone(() => {
_log.add('onEventDone');
// If not implemented correctly, this time will cause another digest,
// which is not what we want.
TimerWrapper.setTimeout(() => { _log.add('asyncTask'); }, 5);
});
示例6: bind
bind(_SET_TIMEOUT).toValue((fn, millis) => TimerWrapper.setTimeout(fn, millis))
示例7: expect
expect(() => { fakeAsync(() => { TimerWrapper.setTimeout(() => {}, 10); })(); })
示例8: flushMessages
/**
* Flushes pending messages and then runs the given function.
*/
// TODO(mlaval): timeout is fragile, test to be rewritten
function flushMessages(fn: () => void) { TimerWrapper.setTimeout(fn, 50); }