From 9c1855624116b5778f26ab9cc9562028de1cfa1c Mon Sep 17 00:00:00 2001 From: Fahri Gedik Date: Tue, 8 Jul 2025 15:20:14 +0300 Subject: [PATCH] Update Angular environment service injection example Revised the example to use the inject() function for EnvironmentService in Angular, reflecting modern dependency injection practices. --- docs/en/framework/ui/angular/environment.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/en/framework/ui/angular/environment.md b/docs/en/framework/ui/angular/environment.md index 7fd1b1273a..68fa516d49 100644 --- a/docs/en/framework/ui/angular/environment.md +++ b/docs/en/framework/ui/angular/environment.md @@ -126,13 +126,14 @@ import { environment } from '../environments/environment'; In order to use the `EnvironmentService` you must inject it in your class as a dependency. ```js -import { EnvironmentService } from '@abp/ng.core'; +import { EnvironmentService } from '@abp/ng.core'; +import { inject } from '@angular/core'; @Component({ /* class metadata here */ }) class DemoComponent { - constructor(private environment: EnvironmentService) {} + private environment = inject(EnvironmentService); } ```