
Angular Core Implementation
- 18 installs
- 5 repo stars
- Updated January 7, 2026
- pluginagentmarketplace/custom-plugin-angular
Helps with ai & agent building tasks.
About
angular-core-implementation is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.
- angular-core-implementation
- AI & Agent Building
- AI-coding skill
Angular Core Implementation by the numbers
- 18 all-time installs (skills.sh)
- Ranked #10,736 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-angular --skill angular-core-implementationAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 18 |
|---|---|
| repo stars | ★ 5 |
| Last updated | January 7, 2026 |
| Repository | pluginagentmarketplace/custom-plugin-angular ↗ |
What it does
Helps with ai & agent building tasks.
Files
Angular Core Implementation Skill
Quick Start
Component Basics
import { Component, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'app-user-card',
template: `
<div class="card">
<h2>{{ user.name }}</h2>
<p>{{ user.email }}</p>
<button (click)="onDelete()">Delete</button>
</div>
`,
styles: [`
.card { border: 1px solid #ddd; padding: 16px; }
`]
})
export class UserCardComponent {
@Input() user!: User;
@Output() deleted = new EventEmitter<void>();
onDelete() {
this.deleted.emit();
}
}Service Creation
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root' // Singleton service
})
export class UserService {
private apiUrl = '/api/users';
constructor(private http: HttpClient) {}
getUsers(): Observable<User[]> {
return this.http.get<User[]>(this.apiUrl);
}
getUser(id: number): Observable<User> {
return this.http.get<User>(`${this.apiUrl}/${id}`);
}
createUser(user: User): Observable<User> {
return this.http.post<User>(this.apiUrl, user);
}
}Dependency Injection
@Injectable()
export class NotificationService {
constructor(
private logger: LoggerService,
private config: ConfigService
) {}
notify(message: string) {
this.logger.log(message);
}
}Core Concepts
Lifecycle Hooks
export class UserListComponent implements
OnInit,
OnChanges,
OnDestroy
{
@Input() users: User[] = [];
ngOnInit() {
// Initialize component, fetch data
this.loadUsers();
}
ngOnChanges(changes: SimpleChanges) {
// Respond to input changes
if (changes['users']) {
this.onUsersChanged();
}
}
ngOnDestroy() {
// Cleanup subscriptions, remove listeners
this.subscription?.unsubscribe();
}
private loadUsers() { /* ... */ }
private onUsersChanged() { /* ... */ }
}Lifecycle Order: 1. ngOnChanges - When input properties change 2. ngOnInit - After first ngOnChanges 3. ngDoCheck - Every change detection cycle 4. ngAfterContentInit - After content is initialized 5. ngAfterContentChecked - After content is checked 6. ngAfterViewInit - After view is initialized 7. ngAfterViewChecked - After view is checked 8. ngOnDestroy - When component is destroyed
Modules
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
@NgModule({
declarations: [
UserListComponent,
UserDetailComponent,
UserFormComponent
],
imports: [
CommonModule,
FormsModule
],
exports: [
UserListComponent,
UserDetailComponent
]
})
export class UserModule { }Lazy Loading
const routes: Routes = [
{ path: 'users', loadChildren: () =>
import('./users/users.module').then(m => m.UsersModule)
}
];Advanced Patterns
Content Projection
// Parent component
<app-card>
<div class="header">Card Title</div>
<div class="content">Card content</div>
</app-card>
// Card component
@Component({
selector: 'app-card',
template: `
<div class="card">
<ng-content select=".header"></ng-content>
<ng-content select=".content"></ng-content>
<ng-content></ng-content>
</div>
`
})
export class CardComponent { }ViewChild and ContentChild
@Component({
selector: 'app-form',
template: `<app-input #firstInput></app-input>`
})
export class FormComponent implements AfterViewInit {
@ViewChild('firstInput') firstInput!: InputComponent;
ngAfterViewInit() {
this.firstInput.focus();
}
}Custom Directive
@Directive({
selector: '[appHighlight]'
})
export class HighlightDirective {
constructor(private el: ElementRef) {
this.el.nativeElement.style.backgroundColor = 'yellow';
}
}
// Usage: <p appHighlight>Highlighted text</p>Encapsulation
View Encapsulation Modes
@Component({
selector: 'app-card',
template: `<div class="card">...</div>`,
styles: [`.card { color: blue; }`],
encapsulation: ViewEncapsulation.Emulated // Default
})
export class CardComponent { }- Emulated (default): CSS scoped to component
- None: Global styles
- ShadowDom: Uses browser shadow DOM
Change Detection
OnPush Strategy
@Component({
selector: 'app-user',
template: `<div>{{ user.name }}</div>`,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class UserComponent {
@Input() user!: User;
constructor(private cdr: ChangeDetectorRef) {}
manualDetection() {
this.cdr.markForCheck();
}
}Provider Patterns
Multi-Provider
@NgModule({
providers: [
{ provide: VALIDATORS, useValue: emailValidator, multi: true },
{ provide: VALIDATORS, useValue: minLengthValidator, multi: true }
]
})
export class ValidatorsModule { }Factory Pattern
@NgModule({
providers: [
{
provide: ConfigService,
useFactory: (env: EnvironmentService) => {
return env.production ?
new ProdConfigService() :
new DevConfigService();
},
deps: [EnvironmentService]
}
]
})
export class AppModule { }Testing Components
describe('UserCardComponent', () => {
let component: UserCardComponent;
let fixture: ComponentFixture<UserCardComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [UserCardComponent]
}).compileComponents();
fixture = TestBed.createComponent(UserCardComponent);
component = fixture.componentInstance;
});
it('should emit deleted when delete button clicked', () => {
spyOn(component.deleted, 'emit');
component.user = { id: 1, name: 'John', email: 'john@example.com' };
fixture.detectChanges();
fixture.debugElement.query(By.css('button')).nativeElement.click();
expect(component.deleted.emit).toHaveBeenCalled();
});
});Performance Optimization
1. Use OnPush: Reduces change detection cycles 2. Unsubscribe: Prevent memory leaks 3. TrackBy: Optimize ngFor rendering 4. Lazy Load: Load modules on demand 5. Avoid property binding in templates*: Use async pipe
// Bad
users: User[] = [];
// Good
users$ = this.userService.getUsers();
<!-- Template -->
<app-user *ngFor="let user of users$ | async; trackBy: trackByUserId">
</app-user>Best Practices
1. Smart vs Presentational: Container components handle logic 2. One Responsibility: Each component has a single purpose 3. Input/Output: Use @Input/@Output for communication 4. Services: Handle business logic and HTTP 5. DI: Always use dependency injection 6. OnDestroy: Clean up subscriptions
Resources
// Angular Component Template
// Use this as a starting point for new components
import { Component, Input, Output, EventEmitter, OnInit, OnDestroy } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-{component-name}',
standalone: true,
imports: [],
template: `
<div class="{component-name}-container">
<!-- Component content -->
</div>
`,
styles: [`
.{component-name}-container {
/* Styles */
}
`]
})
export class {ComponentName}Component implements OnInit, OnDestroy {
// Inputs
@Input() data!: unknown;
// Outputs
@Output() action = new EventEmitter<void>();
// Destroy subject for cleanup
private destroy$ = new Subject<void>();
ngOnInit(): void {
// Initialize component
}
ngOnDestroy(): void {
this.destroy$.next();
this.destroy$.complete();
}
// Methods
onAction(): void {
this.action.emit();
}
}
angular_skill: core
Assets
Templates and reusable assets for core skill.
core Guide
Angular Lifecycle Hooks Quick Reference
Hook Execution Order
1. constructor()
2. ngOnChanges() ← Input changes
3. ngOnInit() ← Initialize
4. ngDoCheck() ← Every CD cycle
5. ngAfterContentInit()
6. ngAfterContentChecked()
7. ngAfterViewInit()
8. ngAfterViewChecked()
9. ngOnDestroy() ← CleanupWhen to Use Each Hook
| Hook | Use Case |
|---|---|
ngOnInit | Fetch data, initialize subscriptions |
ngOnChanges | React to input changes |
ngAfterViewInit | DOM manipulation, ViewChild access |
ngOnDestroy | Cleanup subscriptions, remove listeners |
Best Practices
export class MyComponent implements OnInit, OnDestroy {
private destroy$ = new Subject<void>();
ngOnInit(): void {
this.dataService.getData()
.pipe(takeUntil(this.destroy$))
.subscribe(data => this.data = data);
}
ngOnDestroy(): void {
this.destroy$.next();
this.destroy$.complete();
}
}References
Documentation references for core skill.
#!/bin/bash
# Generate Angular Component with Best Practices
if [ -z "$1" ]; then
echo "Usage: ./generate-component.sh <component-name>"
exit 1
fi
COMPONENT_NAME=$1
# Generate standalone component with OnPush
ng generate component $COMPONENT_NAME \
--standalone \
--change-detection=OnPush \
--skip-tests=false
echo "Component $COMPONENT_NAME generated successfully!"
echo "Remember to:"
echo " 1. Add proper @Input() and @Output() decorators"
echo " 2. Implement OnInit and OnDestroy"
echo " 3. Use takeUntil for subscription cleanup"
#!/usr/bin/env python3
import json
print(json.dumps({"skill": "core"}, indent=2))
Scripts
Automation scripts for core skill.