當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript common.isPlatformServer函數代碼示例

本文整理匯總了TypeScript中@angular/common.isPlatformServer函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript isPlatformServer函數的具體用法?TypeScript isPlatformServer怎麽用?TypeScript isPlatformServer使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了isPlatformServer函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

    it('should find `display` from component styles', () => {
      componentWithTemplate(`<div class="extra"></div>`, ['div.extra { display:table; }']);

      // TODO(CaerusKaru): Domino is unable to detect this style
      if (!isPlatformServer(platformId)) {
        expectNativeEl(fixture).toHaveCSS({'display': 'table'}, styler);
      }
    });
開發者ID:marffox,項目名稱:flex-layout,代碼行數:8,代碼來源:style-utils.spec.ts

示例2: it

    it('should generate complex key', () => {
        const platformId = TestBed.get(PLATFORM_ID);
        if (isPlatformServer(platformId)) {
            sendRequest.apply(mockSendRequest, [{url: 'someurl', data: { filter: { name: 'test'}, select: ['name']}}]);
            let key = makeStateKey('0urlsomeurldatafilternametestselect0name');
            const transferState: TransferState = TestBed.get(TransferState);

            expect(transferState.hasKey(key)).toBe(true);
        }
    });
開發者ID:DevExpress,項目名稱:devextreme-angular2,代碼行數:10,代碼來源:ssr-ajax.spec.ts

示例3: it

    it('should set transfer state for rendererdOnServer option of integration', () => {
        TestBed.overrideComponent(TestContainerComponent, {
            set: {
                template: `<dx-data-grid></dx-data-grid>`
            }
        });
        let platformID = TestBed.get(PLATFORM_ID);
        if (isPlatformServer(platformID)) {
            let fixture = TestBed.createComponent(TestContainerComponent);
            fixture.detectChanges();

            const transferState: TransferState = TestBed.get(TransferState);

            expect(transferState.hasKey(IS_PLATFORM_SERVER)).toBe(true);
            expect(transferState.get(IS_PLATFORM_SERVER, null as any)).toEqual(true);
        }
    });
開發者ID:DevExpress,項目名稱:devextreme-angular2,代碼行數:17,代碼來源:ssr-is-platform-server.spec.ts


注:本文中的@angular/common.isPlatformServer函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。