Skip to content

Commit 8c75745

Browse files
committed
Add ABP Angular component replacement documentation
Expanded guidelines in multiple AI config instruction files to include details and examples for using ABP Angular's ReplaceableComponentsService. This addition covers key features, usage, important notes, and links to full documentation for customizing and replacing default components, layouts, and UI elements.
1 parent 73a8beb commit 8c75745

File tree

6 files changed

+180
-0
lines changed

6 files changed

+180
-0
lines changed

npm/ng-packs/packages/schematics/src/commands/ai-config/files/claude/.claude/CLAUDE.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,36 @@ You write **clean, maintainable, and modular** code following **ABP, ASP.NET Cor
137137
- Provide services using `providedIn: 'root'`.
138138
- Use the **`inject()` function** instead of constructor injection.
139139

140+
### Component Replacement
141+
ABP Angular provides a powerful **component replacement** system via `ReplaceableComponentsService`:
142+
143+
**Key Features:**
144+
- Replace ABP default components (Roles, Users, Tenants, etc.) with custom implementations
145+
- Replace layouts (Application, Account, Empty)
146+
- Replace UI elements (Logo, Routes, NavItems)
147+
148+
**Basic Usage:**
149+
```typescript
150+
import { ReplaceableComponentsService } from '@abp/ng.core';
151+
import { eIdentityComponents } from '@abp/ng.identity';
152+
153+
constructor(private replaceableComponents: ReplaceableComponentsService) {
154+
this.replaceableComponents.add({
155+
component: YourCustomComponent,
156+
key: eIdentityComponents.Roles,
157+
});
158+
}
159+
```
160+
161+
**Important Notes:**
162+
- Component templates must include `<router-outlet></router-outlet>` for layouts
163+
- Use the second parameter as `true` for runtime replacement (refreshes route)
164+
- Runtime replacement clears component state and re-runs initialization logic
165+
166+
**📚 Full Documentation:**
167+
For detailed examples, layout replacement, and advanced scenarios:
168+
[Component Replacement Guide](https://abp.io/docs/latest/framework/ui/angular/customization-user-interface)
169+
140170
---
141171

142172
## 🔒 4. Combined Full-Stack Practices

npm/ng-packs/packages/schematics/src/commands/ai-config/files/copilot/.github/copilot-instructions.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,36 @@ You write **clean, maintainable, and modular** code following **ABP, ASP.NET Cor
137137
- Provide services using `providedIn: 'root'`.
138138
- Use the **`inject()` function** instead of constructor injection.
139139

140+
### Component Replacement
141+
ABP Angular provides a powerful **component replacement** system via `ReplaceableComponentsService`:
142+
143+
**Key Features:**
144+
- Replace ABP default components (Roles, Users, Tenants, etc.) with custom implementations
145+
- Replace layouts (Application, Account, Empty)
146+
- Replace UI elements (Logo, Routes, NavItems)
147+
148+
**Basic Usage:**
149+
```typescript
150+
import { ReplaceableComponentsService } from '@abp/ng.core';
151+
import { eIdentityComponents } from '@abp/ng.identity';
152+
153+
constructor(private replaceableComponents: ReplaceableComponentsService) {
154+
this.replaceableComponents.add({
155+
component: YourCustomComponent,
156+
key: eIdentityComponents.Roles,
157+
});
158+
}
159+
```
160+
161+
**Important Notes:**
162+
- Component templates must include `<router-outlet></router-outlet>` for layouts
163+
- Use the second parameter as `true` for runtime replacement (refreshes route)
164+
- Runtime replacement clears component state and re-runs initialization logic
165+
166+
**📚 Full Documentation:**
167+
For detailed examples, layout replacement, and advanced scenarios:
168+
[Component Replacement Guide](https://abp.io/docs/latest/framework/ui/angular/customization-user-interface)
169+
140170
---
141171

142172
## 🔒 4. Combined Full-Stack Practices

npm/ng-packs/packages/schematics/src/commands/ai-config/files/cursor/.cursor/rules/cursor.mdc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,36 @@ You write **clean, maintainable, and modular** code following **ABP, ASP.NET Cor
137137
- Provide services using `providedIn: 'root'`.
138138
- Use the **`inject()` function** instead of constructor injection.
139139

140+
### Component Replacement
141+
ABP Angular provides a powerful **component replacement** system via `ReplaceableComponentsService`:
142+
143+
**Key Features:**
144+
- Replace ABP default components (Roles, Users, Tenants, etc.) with custom implementations
145+
- Replace layouts (Application, Account, Empty)
146+
- Replace UI elements (Logo, Routes, NavItems)
147+
148+
**Basic Usage:**
149+
```typescript
150+
import { ReplaceableComponentsService } from '@abp/ng.core';
151+
import { eIdentityComponents } from '@abp/ng.identity';
152+
153+
constructor(private replaceableComponents: ReplaceableComponentsService) {
154+
this.replaceableComponents.add({
155+
component: YourCustomComponent,
156+
key: eIdentityComponents.Roles,
157+
});
158+
}
159+
```
160+
161+
**Important Notes:**
162+
- Component templates must include `<router-outlet></router-outlet>` for layouts
163+
- Use the second parameter as `true` for runtime replacement (refreshes route)
164+
- Runtime replacement clears component state and re-runs initialization logic
165+
166+
**📚 Full Documentation:**
167+
For detailed examples, layout replacement, and advanced scenarios:
168+
[Component Replacement Guide](https://abp.io/docs/latest/framework/ui/angular/customization-user-interface)
169+
140170
---
141171

142172
## 🔒 4. Combined Full-Stack Practices

npm/ng-packs/packages/schematics/src/commands/ai-config/files/gemini/.gemini/GEMINI.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,36 @@ You write **clean, maintainable, and modular** code following **ABP, ASP.NET Cor
137137
- Provide services using `providedIn: 'root'`.
138138
- Use the **`inject()` function** instead of constructor injection.
139139

140+
### Component Replacement
141+
ABP Angular provides a powerful **component replacement** system via `ReplaceableComponentsService`:
142+
143+
**Key Features:**
144+
- Replace ABP default components (Roles, Users, Tenants, etc.) with custom implementations
145+
- Replace layouts (Application, Account, Empty)
146+
- Replace UI elements (Logo, Routes, NavItems)
147+
148+
**Basic Usage:**
149+
```typescript
150+
import { ReplaceableComponentsService } from '@abp/ng.core';
151+
import { eIdentityComponents } from '@abp/ng.identity';
152+
153+
constructor(private replaceableComponents: ReplaceableComponentsService) {
154+
this.replaceableComponents.add({
155+
component: YourCustomComponent,
156+
key: eIdentityComponents.Roles,
157+
});
158+
}
159+
```
160+
161+
**Important Notes:**
162+
- Component templates must include `<router-outlet></router-outlet>` for layouts
163+
- Use the second parameter as `true` for runtime replacement (refreshes route)
164+
- Runtime replacement clears component state and re-runs initialization logic
165+
166+
**📚 Full Documentation:**
167+
For detailed examples, layout replacement, and advanced scenarios:
168+
[Component Replacement Guide](https://abp.io/docs/latest/framework/ui/angular/customization-user-interface)
169+
140170
---
141171

142172
## 🔒 4. Combined Full-Stack Practices

npm/ng-packs/packages/schematics/src/commands/ai-config/files/junie/.junie/guidelines.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,36 @@ You write **clean, maintainable, and modular** code following **ABP, ASP.NET Cor
137137
- Provide services using `providedIn: 'root'`.
138138
- Use the **`inject()` function** instead of constructor injection.
139139

140+
### Component Replacement
141+
ABP Angular provides a powerful **component replacement** system via `ReplaceableComponentsService`:
142+
143+
**Key Features:**
144+
- Replace ABP default components (Roles, Users, Tenants, etc.) with custom implementations
145+
- Replace layouts (Application, Account, Empty)
146+
- Replace UI elements (Logo, Routes, NavItems)
147+
148+
**Basic Usage:**
149+
```typescript
150+
import { ReplaceableComponentsService } from '@abp/ng.core';
151+
import { eIdentityComponents } from '@abp/ng.identity';
152+
153+
constructor(private replaceableComponents: ReplaceableComponentsService) {
154+
this.replaceableComponents.add({
155+
component: YourCustomComponent,
156+
key: eIdentityComponents.Roles,
157+
});
158+
}
159+
```
160+
161+
**Important Notes:**
162+
- Component templates must include `<router-outlet></router-outlet>` for layouts
163+
- Use the second parameter as `true` for runtime replacement (refreshes route)
164+
- Runtime replacement clears component state and re-runs initialization logic
165+
166+
**📚 Full Documentation:**
167+
For detailed examples, layout replacement, and advanced scenarios:
168+
[Component Replacement Guide](https://abp.io/docs/latest/framework/ui/angular/customization-user-interface)
169+
140170
---
141171

142172
## 🔒 4. Combined Full-Stack Practices

npm/ng-packs/packages/schematics/src/commands/ai-config/files/windsurf/.windsurf/rules/guidelines.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,36 @@ You write **clean, maintainable, and modular** code following **ABP, ASP.NET Cor
137137
- Provide services using `providedIn: 'root'`.
138138
- Use the **`inject()` function** instead of constructor injection.
139139

140+
### Component Replacement
141+
ABP Angular provides a powerful **component replacement** system via `ReplaceableComponentsService`:
142+
143+
**Key Features:**
144+
- Replace ABP default components (Roles, Users, Tenants, etc.) with custom implementations
145+
- Replace layouts (Application, Account, Empty)
146+
- Replace UI elements (Logo, Routes, NavItems)
147+
148+
**Basic Usage:**
149+
```typescript
150+
import { ReplaceableComponentsService } from '@abp/ng.core';
151+
import { eIdentityComponents } from '@abp/ng.identity';
152+
153+
constructor(private replaceableComponents: ReplaceableComponentsService) {
154+
this.replaceableComponents.add({
155+
component: YourCustomComponent,
156+
key: eIdentityComponents.Roles,
157+
});
158+
}
159+
```
160+
161+
**Important Notes:**
162+
- Component templates must include `<router-outlet></router-outlet>` for layouts
163+
- Use the second parameter as `true` for runtime replacement (refreshes route)
164+
- Runtime replacement clears component state and re-runs initialization logic
165+
166+
**📚 Full Documentation:**
167+
For detailed examples, layout replacement, and advanced scenarios:
168+
[Component Replacement Guide](https://abp.io/docs/latest/framework/ui/angular/customization-user-interface)
169+
140170
---
141171

142172
## 🔒 4. Combined Full-Stack Practices

0 commit comments

Comments
 (0)