Skip to content

Commit ff571e6

Browse files
committed
fixup! feat(platform-server): update server bootstrap API
1 parent 8dab173 commit ff571e6

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

packages/platform-browser/src/browser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export function bootstrapApplicationInternal(
151151
*
152152
* @publicApi
153153
*/
154-
export function createApplication(options?: ApplicationConfig) {
154+
export function createApplication(options?: ApplicationConfig): Promise<ApplicationRef> {
155155
return internalCreateApplication(createProvidersConfig(options));
156156
}
157157

packages/platform-server/src/server.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,11 @@ export function platformServer(extraProviders?: StaticProvider[] | undefined): P
144144
* The root component passed into this function *must* be a standalone.
145145
*
146146
* ```ts
147-
* @Component({
148-
* template: 'Hello world!'
149-
* })
150-
* class RootComponent {}
147+
* import { bootstrapServerApplication } from '@angular/platform-server';
148+
* import { ApplicationConfig } from '@angular/core';
149+
* import { AppComponent } from './app.component';
151150
*
152-
* const bootstrap = bootstrapServerApplication(RootComponent, {
151+
* const bootstrap = bootstrapServerApplication(AppComponent, {
153152
* providers: [
154153
* {provide: BACKEND_URL, useValue: 'https://yourdomain.com/api'}
155154
* ]

packages/platform-server/src/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
ɵstopMeasuring as stopMeasuring,
2424
} from '@angular/core';
2525

26-
import {platformServer, bootstrapServerApplication} from './server';
26+
import {bootstrapServerApplication, platformServer} from './server';
2727
import {PlatformState} from './platform_state';
2828
import {BEFORE_APP_SERIALIZED, INITIAL_CONFIG} from './tokens';
2929
import {createScript} from './transfer_state';
@@ -298,10 +298,10 @@ export async function renderModule<T>(
298298
* import { renderApplication } from '@angular/platform-server';
299299
* import { bootstrapServerApplication } from '@angular/platform-server';
300300
* import { ApplicationConfig } from '@angular/core';
301-
* import { RootComponent } from './app.component';
301+
* import { AppComponent } from './app.component';
302302
*
303303
* const appConfig: ApplicationConfig = { providers: [...] };
304-
* const bootstrap = bootstrapServerApplication(RootComponent, appConfig);
304+
* const bootstrap = bootstrapServerApplication(AppComponent, appConfig);
305305
* const output = await renderApplication(bootstrap);
306306
* ```
307307
*

0 commit comments

Comments
 (0)