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

Commit 06d3a51

Browse files
committed
feat(universal): ngOnStable lifecycle
1 parent 49c42d2 commit 06d3a51

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

modules/universal/src/node/bootloader.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export interface BootloaderConfig {
1919
directives?: Array<any>;
2020
preboot?: any;
2121
precache?: boolean;
22+
ngOnStable?: Function;
2223
}
2324

2425
function checkProviders(providers) {
@@ -163,6 +164,17 @@ export class Bootloader {
163164
console.log('preboot Error:', err);
164165
throw err;
165166
})
167+
.then((configRefs: any) => {
168+
if ('ngOnStable' in this._config) {
169+
if (!this._config.ngOnStable) { return configRefs; }
170+
return this._config.ngOnStable(configRefs);
171+
}
172+
return configRefs;
173+
})
174+
.catch(err => {
175+
console.log('ngOnStable Error:', err);
176+
throw err;
177+
})
166178
.then((configRefs: any) => {
167179
let document = configRefs[0].appRef.injector.get(DOCUMENT);
168180
let rendered = Bootloader.serializeDocument(document);

0 commit comments

Comments
 (0)