From 83a1f0e9f5d9bc0b94534e65d32b90b794ca1f6f Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Tue, 17 Dec 2024 16:50:44 +0100 Subject: [PATCH] Use app.config.ts Signed-off-by: Timo Stamm --- angular/src/app/app.config.ts | 12 ++++++++++++ angular/src/main.ts | 17 +++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 angular/src/app/app.config.ts diff --git a/angular/src/app/app.config.ts b/angular/src/app/app.config.ts new file mode 100644 index 000000000..04beb6828 --- /dev/null +++ b/angular/src/app/app.config.ts @@ -0,0 +1,12 @@ +import { ApplicationConfig } from '@angular/core'; +import { provideConnect } from "../connect/connect.module"; +import { provideProtractorTestingSupport } from "@angular/platform-browser"; + +export const appConfig: ApplicationConfig = { + providers: [ + provideConnect({ + baseUrl: "https://demo.connectrpc.com", + }), + provideProtractorTestingSupport(), + ], +}; diff --git a/angular/src/main.ts b/angular/src/main.ts index 134f7d327..a878a05ed 100644 --- a/angular/src/main.ts +++ b/angular/src/main.ts @@ -1,18 +1,7 @@ -/* - * Protractor support is deprecated in Angular. - * Protractor is used in this example for compatibility with Angular documentation tools. - */ -import { bootstrapApplication, provideProtractorTestingSupport } from '@angular/platform-browser'; +import { bootstrapApplication } from '@angular/platform-browser'; import { AppComponent } from './app/app.component'; -import { provideConnect } from "./connect/connect.module"; +import { appConfig } from "./app/app.config"; -bootstrapApplication(AppComponent, { - providers: [ - provideConnect({ - baseUrl: "https://demo.connectrpc.com", - }), - provideProtractorTestingSupport(), - ], -}).catch((err) => +bootstrapApplication(AppComponent, appConfig).catch((err) => console.error(err), );