Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 2bdeb32

Browse files
committed
feat(universal): isNode and isBrowser support
1 parent f539389 commit 2bdeb32

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

modules/universal/src/browser/browser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ export * from './bootstrap';
22
export * from './ng_preload_cache';
33
export * from '../common';
44

5+
export * from './env';
6+
57
export * from './platform';
68
export * from './http';
79
export * from './router';

modules/universal/src/browser/env.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const isBrowser = true;
2+
export const isNode = false;

modules/universal/src/browser/http.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
import {HTTP_PROVIDERS} from '@angular/http';
1+
import {HTTP_PROVIDERS, JSONP_PROVIDERS} from '@angular/http';
22

33
export const BROWSER_HTTP_PROVIDERS = HTTP_PROVIDERS;
4+
export const BROWSER_JSONP_PROVIDERS = JSONP_PROVIDERS;

modules/universal/src/node/env.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const isBrowser = false;
2+
export const isNode = true;

modules/universal/src/node/node.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export {provide, Inject, Optional, enableProdMode} from '@angular/core';
66

77
export * from './directives/index';
88

9+
910
export * from './http/index';
1011

1112
export * from './pipes/index';
@@ -14,6 +15,8 @@ export * from './platform/index';
1415

1516
export * from './router/index';
1617

18+
export * from './env';
19+
1720
export * from './bootloader';
1821
export * from './helper';
1922
export * from './ng_preboot';

0 commit comments

Comments
 (0)