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