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 5e90a44ae1ee0416b2a27b88ea17a6cbc9375b82 Author: Philipp Zehnder <[email protected]> AuthorDate: Tue Mar 24 11:13:08 2026 +0100 migrate shared UI services to inject() --- .../streampipes/shared-ui/src/lib/services/current-user.service.ts | 4 ++-- .../streampipes/shared-ui/src/lib/services/date-format.service.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/projects/streampipes/shared-ui/src/lib/services/current-user.service.ts b/ui/projects/streampipes/shared-ui/src/lib/services/current-user.service.ts index 2eb4e5b051..885edf6d89 100644 --- a/ui/projects/streampipes/shared-ui/src/lib/services/current-user.service.ts +++ b/ui/projects/streampipes/shared-ui/src/lib/services/current-user.service.ts @@ -18,12 +18,12 @@ import { BehaviorSubject } from 'rxjs'; import { UserInfo } from '@streampipes/platform-services'; -import { Injectable } from '@angular/core'; +import { Injectable, inject } from '@angular/core'; import { JwtTokenStorageService } from './jwt-token-storage.service'; @Injectable({ providedIn: 'root' }) export class CurrentUserService { - constructor(private jwtTokenStorageService: JwtTokenStorageService) {} + private jwtTokenStorageService = inject(JwtTokenStorageService); public authToken$: BehaviorSubject<string> = new BehaviorSubject<string>( undefined, diff --git a/ui/projects/streampipes/shared-ui/src/lib/services/date-format.service.ts b/ui/projects/streampipes/shared-ui/src/lib/services/date-format.service.ts index 539fdf14f7..f25b857dbc 100644 --- a/ui/projects/streampipes/shared-ui/src/lib/services/date-format.service.ts +++ b/ui/projects/streampipes/shared-ui/src/lib/services/date-format.service.ts @@ -15,14 +15,14 @@ * limitations under the License. * */ -import { Injectable } from '@angular/core'; +import { Injectable, inject } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; @Injectable({ providedIn: 'root', }) export class DateFormatService { - constructor(private translateService: TranslateService) {} + private translateService = inject(TranslateService); formatDate(timestamp?: number): string { if (!timestamp) {
