We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
PLATFORM_ID
initTransferState
1 parent ff772d7 commit f2a8006Copy full SHA for f2a8006
1 file changed
packages/core/src/transfer_state.ts
@@ -6,7 +6,7 @@
6
* found in the LICENSE file at https://angular.dev/license
7
*/
8
9
-import {APP_ID, PLATFORM_ID} from './application/application_tokens';
+import {APP_ID} from './application/application_tokens';
10
import {inject} from './di/injector_compatibility';
11
import {ɵɵdefineInjectable} from './di/interface/defs';
12
import {getDocument} from './render3/interfaces/document';
@@ -50,7 +50,7 @@ export function makeStateKey<T = void>(key: string): StateKey<T> {
50
51
function initTransferState(): TransferState {
52
const transferState = new TransferState();
53
- if (inject(PLATFORM_ID) === 'browser') {
+ if (typeof ngServerMode === 'undefined' || !ngServerMode) {
54
transferState.store = retrieveTransferredState(getDocument(), inject(APP_ID));
55
}
56
0 commit comments