本文整理匯總了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);
});
});