Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9c18556
Update Angular environment service injection example
fahrigedik Jul 8, 2025
dbc82fa
Update Angular service injection example
fahrigedik Jul 8, 2025
218e11e
Update config-state-service.md
fahrigedik Jul 8, 2025
b8261a6
Update http-requests.md
fahrigedik Jul 8, 2025
37b0a78
Update localization.md
fahrigedik Jul 8, 2025
65c3af1
Update settings.md
fahrigedik Jul 8, 2025
81ccc46
Update features.md
fahrigedik Jul 8, 2025
da5d56a
Update global-features.md
fahrigedik Jul 8, 2025
8c4f154
Update permission-management.md
fahrigedik Jul 8, 2025
a2302c1
Update subscription-service.md
fahrigedik Jul 8, 2025
4b1358b
Update list-service.md
fahrigedik Jul 8, 2025
ffd36c7
Update track-by-service.md
fahrigedik Jul 8, 2025
1107fac
Update dom-insertion-service.md
fahrigedik Jul 8, 2025
78aeba1
Update lazy-load-service.md
fahrigedik Jul 8, 2025
87ef71e
Update content-projection-service.md
fahrigedik Jul 8, 2025
8250c46
Update modal.md
fahrigedik Jul 8, 2025
2f95ee5
Update confirmation-service.md
fahrigedik Jul 8, 2025
ea56152
Update toaster-service.md
fahrigedik Jul 8, 2025
a7ff215
Update page-alerts.md
fahrigedik Jul 8, 2025
cc97483
Update abp-window-service.md
fahrigedik Jul 8, 2025
9c2a560
Update theming.md
fahrigedik Jul 8, 2025
53149ef
Update angular.md
fahrigedik Jul 8, 2025
af48837
Update modifying-the-menu.md
fahrigedik Jul 8, 2025
08c864b
Update component-replacement.md
fahrigedik Jul 8, 2025
0baa1bb
Update page-component.md
fahrigedik Jul 8, 2025
ccf3e7c
Update router-events.md
fahrigedik Jul 9, 2025
5da47ff
Update Angular docs to use inject() for DI
fahrigedik Jul 24, 2025
b088615
Refactor Angular docs to use inject() for services
fahrigedik Jul 24, 2025
600a477
Update Angular component replacement example
fahrigedik Jul 24, 2025
7b36c20
fix: typos and some comments
sumeyyeKurtulus Jul 24, 2025
68d4f8e
Merge branch 'issue-23270' of https://github.com/abpframework/abp int…
fahrigedik Jul 24, 2025
34e386f
update: resolve comments to use new injection instead
sumeyyeKurtulus Jul 25, 2025
8b18629
Merge branch 'dev' into issue-23270
fahrigedik Sep 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions docs/en/framework/ui/angular/abp-window-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ Firstly, ensure that the service is injected into the component or any other Ang

```js
import { AbpWindowService } from '@abp/ng.core';
import { inject } from '@angular/core';

constructor(private abpWindowService: AbpWindowService) { }
// or
// private abpWindowService = inject(AbpWindowService)
private abpWindowService = inject(AbpWindowService)
```

### Downloading a Blob
Expand Down
53 changes: 26 additions & 27 deletions docs/en/framework/ui/angular/component-replacement.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ Then, open the `app.component.ts` and execute the `add` method of `ReplaceableCo
```js
import { ReplaceableComponentsService } from '@abp/ng.core'; // imported ReplaceableComponentsService
import { eIdentityComponents } from '@abp/ng.identity'; // imported eIdentityComponents enum
import { Component, inject } from '@angular/core';
//...

@Component(/* component metadata */)
export class AppComponent {
constructor(
private replaceableComponents: ReplaceableComponentsService, // injected the service
) {
private replaceableComponents = inject(ReplaceableComponentsService);

constructor() {
this.replaceableComponents.add({
component: YourNewRoleComponent,
key: eIdentityComponents.Roles,
Expand Down Expand Up @@ -56,12 +57,13 @@ Open `app.component.ts` in `src/app` folder and modify it as shown below:
import { ReplaceableComponentsService } from '@abp/ng.core'; // imported ReplaceableComponentsService
import { eThemeBasicComponents } from '@abp/ng.theme.basic'; // imported eThemeBasicComponents enum for component keys
import { MyApplicationLayoutComponent } from './my-application-layout/my-application-layout.component'; // imported MyApplicationLayoutComponent
import { Component, inject } from '@angular/core';

@Component(/* component metadata */)
export class AppComponent {
constructor(
private replaceableComponents: ReplaceableComponentsService, // injected the service
) {
private replaceableComponents = inject(ReplaceableComponentsService);

constructor() {
this.replaceableComponents.add({
component: MyApplicationLayoutComponent,
key: eThemeBasicComponents.ApplicationLayout,
Expand Down Expand Up @@ -268,15 +270,15 @@ import { eThemeBasicComponents } from '@abp/ng.theme.basic'; // imported eThemeB

@Component(/* component metadata */)
export class AppComponent implements OnInit {
constructor(..., private replaceableComponents: ReplaceableComponentsService) {} // injected ReplaceableComponentsService
private replaceableComponents = inject(ReplaceableComponentsService);

ngOnInit() {
//...

this.replaceableComponents.add({
component: LogoComponent,
key: eThemeBasicComponents.Logo,
});
component: LogoComponent,
key: eThemeBasicComponents.Logo,
});
}
}
```
Expand Down Expand Up @@ -454,15 +456,15 @@ import { eThemeBasicComponents } from '@abp/ng.theme.basic'; // imported eThemeB

@Component(/* component metadata */)
export class AppComponent implements OnInit {
constructor(..., private replaceableComponents: ReplaceableComponentsService) {} // injected ReplaceableComponentsService
private replaceableComponents = inject(ReplaceableComponentsService);

ngOnInit() {
//...

this.replaceableComponents.add({
component: RoutesComponent,
key: eThemeBasicComponents.Routes,
});
component: RoutesComponent,
key: eThemeBasicComponents.Routes,
});
}
}
```
Expand Down Expand Up @@ -493,7 +495,7 @@ import {
SessionStateService,
LocalizationPipe
} from '@abp/ng.core';
import { Component, Inject } from '@angular/core';
import { Component, inject, Inject } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
Expand All @@ -512,9 +514,13 @@ import snq from 'snq';
]
})
export class NavItemsComponent {
private configState = inject(ConfigStateService);
private authService = inject(AuthService);
private sessionState = inject(SessionStateService);
@Inject(NAVIGATE_TO_MANAGE_PROFILE) public navigateToManageProfile: any;

currentUser$: Observable<CurrentUserDto> = this.configState.getOne$('currentUser');
selectedTenant$ = this.sessionState.getTenant$();

languages$: Observable<LanguageInfo[]> = this.configState.getDeep$('localization.languages');

get smallScreen(): boolean {
Expand Down Expand Up @@ -547,13 +553,6 @@ export class NavItemsComponent {
return this.sessionState.getLanguage();
}

constructor(
@Inject(NAVIGATE_TO_MANAGE_PROFILE) public navigateToManageProfile,
private configState: ConfigStateService,
private authService: AuthService,
private sessionState: SessionStateService
) {}

onChangeLang(cultureName: string) {
this.sessionState.setLanguage(cultureName);
}
Expand Down Expand Up @@ -669,15 +668,15 @@ import { eThemeBasicComponents } from '@abp/ng.theme.basic'; // imported eThemeB

@Component(/* component metadata */)
export class AppComponent implements OnInit {
constructor(..., private replaceableComponents: ReplaceableComponentsService) {} // injected ReplaceableComponentsService
private replaceableComponents = inject(ReplaceableComponentsService);

ngOnInit() {
//...

this.replaceableComponents.add({
component: NavItemsComponent,
key: eThemeBasicComponents.NavItems,
});
component: NavItemsComponent,
key: eThemeBasicComponents.NavItems,
});
}
}
```
Expand Down
5 changes: 4 additions & 1 deletion docs/en/framework/ui/angular/config-state-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ In order to use the `ConfigStateService` you must inject it in your class as a d

```js
import { ConfigStateService } from '@abp/ng.core';
import { inject } from '@angular/core';

@Component({
/* class metadata here */
})
class DemoComponent {
private config = inject(ConfigStateService);
private config = inject(ConfigStateService);
}
```

Expand Down Expand Up @@ -126,10 +127,12 @@ You can get the application configuration response and set the `ConfigStateServi

```js
import { AbpApplicationConfigurationService, ConfigStateService } from '@abp/ng.core';
import { inject } from '@angular/core';

private abpApplicationConfigurationService = inject(AbpApplicationConfigurationService);
private config = inject(ConfigStateService);


constructor() {
this.abpApplicationConfigurationService.get({ includeLocalizationResources: false }).subscribe(config => {
this.config.setState(config);
Expand Down
12 changes: 9 additions & 3 deletions docs/en/framework/ui/angular/confirmation-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ You do not have to provide the `ConfirmationService` at component level, because

```js
import { ConfirmationService } from '@abp/ng.theme.shared';
import { inject } from '@angular/core';

@Component({
/* class metadata here */
})
class DemoComponent {
constructor(private confirmation: ConfirmationService) {}
private confirmation = inject(ConfirmationService);
}
```

Expand All @@ -36,8 +37,10 @@ You can subscribe to the confirmation closing event like below:

```js
import { Confirmation, ConfirmationService } from '@abp/ng.theme.shared';
import { inject } from '@angular/core';

constructor(private confirmation: ConfirmationService) {}
// inside the class:
private confirmation = inject(ConfirmationService);

this.confirmation
.warn('::WillBeDeleted', { key: '::AreYouSure', defaultValue: 'Are you sure?' })
Expand Down Expand Up @@ -132,7 +135,10 @@ this.confirmation.clear();
You can change icons with the `withConfirmationIcon()` method inside `provideAbpThemeShared` function in the app.config.ts. The changes will affect all confirmation popup in the project.

```ts
import { provideAbpThemeShared, withConfirmationIcon } from '@abp/ng.theme.shared';
import {
provideAbpThemeShared,
withConfirmationIcon,
} from "@abp/ng.theme.shared";

export const appConfig: ApplicationConfig = {
providers: [
Expand Down
3 changes: 2 additions & 1 deletion docs/en/framework/ui/angular/content-projection-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ You do not have to provide the `ContentProjectionService` at module or component

```js
import { ContentProjectionService } from '@abp/ng.core';
import { inject } from '@angular/core';

@Component({
/* class metadata here */
})
class DemoComponent {
constructor(private contentProjectionService: ContentProjectionService) {}
private contentProjectionService = inject(ContentProjectionService);
}
```

Expand Down
13 changes: 8 additions & 5 deletions docs/en/framework/ui/angular/dom-insertion-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ You do not have to provide the `DomInsertionService` at module or component leve

```js
import { DomInsertionService } from '@abp/ng.core';
import { inject } from '@angular/core';

@Component({
/* class metadata here */
})
class DemoComponent {
constructor(private domInsertionService: DomInsertionService) {}
private domInsertionService = inject(DomInsertionService);
}
```

Expand All @@ -27,12 +28,13 @@ The first parameter of `insertContent` method expects a `ContentStrategy`. If yo

```js
import { DomInsertionService, CONTENT_STRATEGY } from '@abp/ng.core';
import { inject } from '@angular/core';

@Component({
/* class metadata here */
})
class DemoComponent {
constructor(private domInsertionService: DomInsertionService) {}
private domInsertionService = inject(DomInsertionService);

ngOnInit() {
const scriptElement = this.domInsertionService.insertContent(
Expand All @@ -54,12 +56,13 @@ If you pass a `StyleContentStrategy` instance as the first parameter of `insertC

```js
import { DomInsertionService, CONTENT_STRATEGY } from '@abp/ng.core';
import { inject } from '@angular/core';

@Component({
/* class metadata here */
})
class DemoComponent {
constructor(private domInsertionService: DomInsertionService) {}
private domInsertionService = inject(DomInsertionService);

ngOnInit() {
const styleElement = this.domInsertionService.insertContent(
Expand All @@ -81,15 +84,15 @@ If you pass the inserted `HTMLScriptElement` or `HTMLStyleElement` element as th

```js
import { DomInsertionService, CONTENT_STRATEGY } from '@abp/ng.core';
import { inject } from '@angular/core';

@Component({
/* class metadata here */
})
class DemoComponent {
private domInsertionService = inject(DomInsertionService);
private styleElement: HTMLStyleElement;

constructor(private domInsertionService: DomInsertionService) {}

ngOnInit() {
this.styleElement = this.domInsertionService.insertContent(
CONTENT_STRATEGY.AppendStyleToHead('body {margin: 0;}')
Expand Down
3 changes: 2 additions & 1 deletion docs/en/framework/ui/angular/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ export const appConfig: ApplicationConfig = {
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 */
Expand Down
3 changes: 2 additions & 1 deletion docs/en/framework/ui/angular/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ To use the `ConfigStateService`, you must inject it in your class as a dependenc

```js
import { ConfigStateService } from '@abp/ng.core';
import { inject } from '@angular/core';

@Component({
/* class metadata here */
})
class DemoComponent {
constructor(private config: ConfigStateService) {}
private config = inject(ConfigStateService);
}
```

Expand Down
7 changes: 3 additions & 4 deletions docs/en/framework/ui/angular/global-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ The `ConfigStateService.getGlobalFeatures` API allows you to get the enabled fea
````js

import { ConfigStateService } from '@abp/ng.core';
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';

@Component({
/* class metadata here */
})
class DemoComponent implements OnInit {
constructor(private config: ConfigStateService) {}
private config = inject(ConfigStateService);

ngOnInit(): void {
// Gets all enabled global features.
const getGlobalFeatures = this.config.getGlobalFeatures();
Expand Down Expand Up @@ -44,4 +44,3 @@ class DemoComponent implements OnInit {
}
}


Loading