You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2026/03/24 11:17:30 UTC
(streampipes) 01/24: migrate app shell to inject()
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch 4287-migrate-angular-ui-from-constructor-injection-to-inject
in repository https://gitbox.apache.org/repos/asf/streampipes.git
commit a7197d3333c250ea29c52b150844137372f3fa55
Author: Philipp Zehnder <te...@users.noreply.github.com>
AuthorDate: Tue Mar 24 09:39:13 2026 +0100
migrate app shell to inject()
---
ui/src/app/app.component.ts | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/ui/src/app/app.component.ts b/ui/src/app/app.component.ts
index 50f986441c..7b246bcec3 100644
--- a/ui/src/app/app.component.ts
+++ b/ui/src/app/app.component.ts
@@ -16,7 +16,7 @@
*
*/
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, inject } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { slideInAnimation } from './animation';
import { Title } from '@angular/platform-browser';
@@ -31,11 +31,13 @@ import { LoadingBarModule } from '@ngx-loading-bar/core';
imports: [LoadingBarModule, RouterOutlet],
})
export class AppComponent implements OnInit {
- constructor(
- private titleService: Title,
- private appConstants: AppConstants,
- private translate: TranslateService,
- ) {
+ private titleService = inject(Title);
+ private appConstants = inject(AppConstants);
+ private translate = inject(TranslateService);
+
+ constructor() {
+ const translate = this.translate;
+
const supportedLanguages = ['de', 'en', 'pl'];
const defaultLanguage = 'en';
this.translate.addLangs(supportedLanguages);