本文整理汇总了TypeScript中@angular/core.NgZone类的典型用法代码示例。如果您正苦于以下问题:TypeScript NgZone类的具体用法?TypeScript NgZone怎么用?TypeScript NgZone使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NgZone类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: expect
events.on(element, 'click', () => {
expect(NgZone.isInAngularZone()).toBe(true);
counter++;
});
示例2:
next: () => {
NgZone.assertNotInAngularZone();
_log.add('onMyTaskDone');
}
示例3: macroTask
macroTask(() => { expect(_zone.runTask(() => 6)).toEqual(6); });
示例4:
this.sub = competitions$.subscribe(heroes => {
this.competitions = heroes;
this.zone.run(() => { });
});
示例5:
Tracker.autorun(() => {
this.ngZone.run(() => {
this.plant = Plants.findOne(this.plantId)
});
});
示例6:
element['onPress'] = (...cbArgs: Array<any>) => {zone.run(() => deepCB.apply(target, cbArgs));}
示例7:
const handler = (changes: Object[]) => {
this.ngZone.run(() => {
this.categories = Category.parseRows(changes.pop()['object']);
});
};
示例8:
electron.ipcRenderer.on('mail:fetch', (event, mails) => {
this.zone.run(() => {
this.registerContactsFrom(mails);
this.mails = mails.slice().reverse().concat(this.mails);
});
});