mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
feat(platform-server): support document reference in render functions (#47032)
This commit updates the `renderModule` and `renderApplication` functions to also accept a document reference (in addition to the serialized document contents as a string). This should provide the necessary flexibility to NgUniversal (and other API consumers) to structure the logic to avoid serializing and parsing document multiple times during the SSR request. PR Close #47032
This commit is contained in:
committed by
Dylan Hunn
parent
de1e28006b
commit
2b4d7f6733
@@ -51,7 +51,7 @@ export class PlatformState {
|
||||
// @public
|
||||
export function renderApplication<T>(rootComponent: Type<T>, options: {
|
||||
appId: string;
|
||||
document?: string;
|
||||
document?: string | Document;
|
||||
url?: string;
|
||||
providers?: Array<Provider | ImportedNgModuleProviders>;
|
||||
platformProviders?: Provider[];
|
||||
@@ -59,7 +59,7 @@ export function renderApplication<T>(rootComponent: Type<T>, options: {
|
||||
|
||||
// @public
|
||||
export function renderModule<T>(module: Type<T>, options: {
|
||||
document?: string;
|
||||
document?: string | Document;
|
||||
url?: string;
|
||||
extraProviders?: StaticProvider[];
|
||||
}): Promise<string>;
|
||||
|
||||
Reference in New Issue
Block a user