How to use the devextreme/core/utils/ready_callbacks.add function in devextreme

To help you get started, we’ve selected a few devextreme examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DevExpress / devextreme-angular / tests / src / ui / events.spec.ts View on Github external
it('should be subscribed within Angular Zone', () => {
        let readyCallbacksCalls = 0;
        readyCallbacks.fire();

        readyCallbacks.add(() => {
            readyCallbacksCalls++;
            NgZone.assertInAngularZone();
        });
        expect(readyCallbacksCalls).toBe(0);

        TestBed.configureTestingModule({
            declarations: [TestContainerComponent],
            imports: [DxDataGridModule]
        });

        TestBed.overrideComponent(TestContainerComponent, {
            set: { template: `` }
        });

        TestBed.createComponent(TestContainerComponent);
        expect(readyCallbacksCalls).toBe(1);