Token导航 LogoToken导航TokenDH.com
研究检索权限需确认github未标认证来源可访问clear审计未展示

angular-componentAngular component 搜索

Agent Skill

angular-component 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

218

周安装

9

GitHub Stars

公开资料未说明

下载量

71
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:angular-component(Angular component 搜索)
来源仓库:https://github.com/simon-jarillo/prueba-skills
仓库路径:skills/angular-component
安装命令:
npx skills add simon-jarillo/prueba-skills --skill "angular-component"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add simon-jarillo/prueba-skills --skill "angular-component"

简介

angular-component 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词快速定位候选结果时使用。

  • 它支持基于任务场景或来源线索进行信息聚合与筛选,适用于研究类工作流。
  • 通过 npx skills add simon-jarillo/prueba-skills --skill "angular-component" 命令安装。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

name
angular-component
description
Create standalone Angular components with signal inputs/outputs, OnPush change detection, host bindings, content projection, and lifecycle hooks. Use when creating new components, refactoring class components, implementing presentation/container patterns, or working with component composition in Angular 19+.

Angular Component

Modern Angular component patterns with standalone components, signals, and OnPush change detection.

Basic Component Structure

import { Component, ChangeDetectionStrategy } from '@angular/core';

@Component({
  selector: 'app-example',
  standalone: true,
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [],
  template: `
    <div>Component content</div>
  `
})
export class ExampleComponent {}

Signal Inputs (Angular 17.1+)

Required Inputs

import { Component, input } from '@angular/core';

@Component({
  selector: 'app-user-card',
  standalone: true,
  template: `
    <h2>{{ name() }}</h2>
    <p>{{ email() }}</p>
  `
})
export class UserCardComponent {
  // Required input
  name = input.required<string>();
  email = input.required<string>();
}

// Usage
<app-user-card [name]="userName" [email]="userEmail" />

Optional Inputs with Defaults

import { Component, input } from '@angular/core';

@Component({
  selector: 'app-badge',
  template: `
    <span [class]="'badge badge-' + variant()">
      {{ text() }}
    </span>
  `
})
export class BadgeComponent {
  text = input<string>('Badge');
  variant = input<'primary' | 'secondary' | 'success'>('primary');
}

Transformed Inputs

import { Component, input } from '@angular/core';

@Component({
  selector: 'app-price',
  template: `<span>{{ formattedPrice() }}</span>`
})
export class PriceComponent {
  // Transform string to number
  price = input(0, {
    transform: (value: string | number) => 
      typeof value === 'string' ? parseFloat(value) : value
  });
  
  formattedPrice = computed(() => 
    new Intl.NumberFormat('en-US', {
      style: 'currency',
      currency: 'USD'
    }).format(this.price())
  );
}

// Usage: <app-price price="99.99" />

Signal Outputs (Angular 17.3+)

import { Component, output } from '@angular/core';

@Component({
  selector: 'app-button',
  template: `
    <button (click)="handleClick()">
      {{ label() }}
    </button>
  `
})
export class ButtonComponent {
  label = input<string>('Click me');
  clicked = output<MouseEvent>();
  
  handleClick() {
    this.clicked.emit(new MouseEvent('click'));
  }
}

// Usage
<app-button 
  label="Submit" 
  (clicked)="onSubmit($event)" 
/>

Output with Custom Event Type

import { Component, output } from '@angular/core';

interface FormSubmitEvent {
  data: Record<string, any>;
  timestamp: number;
}

@Component({
  selector: 'app-form',
  template: `...`
})
export class FormComponent {
  submitted = output<FormSubmitEvent>();
  
  onSubmit(formData: Record<string, any>) {
    this.submitted.emit({
      data: formData,
      timestamp: Date.now()
    });
  }
}

Host Bindings

Class Bindings

import { Component, input } from '@angular/core';

@Component({
  selector: 'app-card',
  standalone: true,
  host: {
    '[class.card]': 'true',
    '[class.card-elevated]': 'elevated()',
    '[class.card-bordered]': 'bordered()'
  },
  template: `<ng-content />`
})
export class CardComponent {
  elevated = input(false);
  bordered = input(true);
}

Attribute Bindings

import { Component, input } from '@angular/core';

@Component({
  selector: 'app-clickable',
  host: {
    '[attr.role]': '"button"',
    '[attr.tabindex]': 'disabled() ? -1 : 0',
    '[attr.aria-disabled]': 'disabled()'
  },
  template: `<ng-content />`
})
export class ClickableComponent {
  disabled = input(false);
}

Event Bindings

import { Component, output } from '@angular/core';

@Component({
  selector: 'app-interactive',
  host: {
    '(click)': 'handleClick($event)',
    '(keydown.enter)': 'handleEnter($event)',
    '(focus)': 'handleFocus()',
    '(blur)': 'handleBlur()'
  },
  template: `<ng-content />`
})
export class InteractiveComponent {
  clicked = output<MouseEvent>();
  focused = output<void>();
  
  handleClick(event: MouseEvent) {
    this.clicked.emit(event);
  }
  
  handleEnter(event: KeyboardEvent) {
    this.clicked.emit(event as any);
  }
  
  handleFocus() {
    this.focused.emit();
  }
  
  handleBlur() {}
}

Content Projection

Single Slot Projection

@Component({
  selector: 'app-card',
  template: `
    <div class="card">
      <ng-content />
    </div>
  `
})
export class CardComponent {}

// Usage
<app-card>
  <h2>Title</h2>
  <p>Content</p>
</app-card>

Multiple Slot Projection

@Component({
  selector: 'app-card',
  template: `
    <div class="card">
      <div class="card-header">
        <ng-content select="[header]" />
      </div>
      <div class="card-body">
        <ng-content />
      </div>
      <div class="card-footer">
        <ng-content select="[footer]" />
      </div>
    </div>
  `
})
export class CardComponent {}

// Usage
<app-card>
  <div header>Header Content</div>
  <p>Body Content</p>
  <div footer>Footer Content</div>
</app-card>

Conditional Content Projection

import { Component, input, contentChild } from '@angular/core';

@Component({
  selector: 'app-expandable',
  template: `
    <div class="header" (click)="toggle()">
      <ng-content select="[header]" />
    </div>
    @if (expanded()) {
      <div class="content">
        <ng-content />
      </div>
    }
  `
})
export class ExpandableComponent {
  expanded = input(false);
  
  toggle() {
    // Implementation
  }
}

ViewChild and ContentChild with Signals

viewChild (Angular 17.3+)

import { Component, viewChild, ElementRef, afterNextRender } from '@angular/core';

@Component({
  selector: 'app-autofocus',
  template: `
    <input #inputElement type="text" />
  `
})
export class AutofocusComponent {
  inputElement = viewChild<ElementRef<HTMLInputElement>>('inputElement');
  
  constructor() {
    afterNextRender(() => {
      this.inputElement()?.nativeElement.focus();
    });
  }
}

contentChild

import { Component, contentChild, Directive } from '@angular/core';

@Directive({
  selector: '[appFormField]',
  standalone: true
})
export class FormFieldDirective {}

@Component({
  selector: 'app-form-wrapper',
  template: `
    <div class="form-wrapper">
      <ng-content />
    </div>
  `
})
export class FormWrapperComponent {
  formField = contentChild(FormFieldDirective);
  
  ngAfterContentInit() {
    if (this.formField()) {
      console.log('Form field found');
    }
  }
}

Lifecycle Hooks

Modern Lifecycle with Signals

import { 
  Component, 
  input, 
  effect,
  afterNextRender,
  afterRender
} from '@angular/core';

@Component({
  selector: 'app-lifecycle',
  template: `<p>{{ data() }}</p>`
})
export class LifecycleComponent {
  data = input.required<string>();
  
  constructor() {
    // Runs when input signals change
    effect(() => {
      console.log('Data changed:', this.data());
    });
    
    // Runs once after first render
    afterNextRender(() => {
      console.log('First render complete');
    });
    
    // Runs after every render
    afterRender(() => {
      console.log('Render complete');
    });
  }
}

Traditional Lifecycle Hooks

import { 
  Component, 
  OnInit, 
  OnDestroy, 
  AfterViewInit 
} from '@angular/core';

@Component({
  selector: 'app-traditional',
  template: `...`
})
export class TraditionalComponent implements OnInit, OnDestroy, AfterViewInit {
  ngOnInit() {
    console.log('Component initialized');
  }
  
  ngAfterViewInit() {
    console.log('View initialized');
  }
  
  ngOnDestroy() {
    console.log('Component destroyed');
  }
}

Component Composition

Container/Presentation Pattern

// Presentation Component (Dumb)
@Component({
  selector: 'app-user-list',
  standalone: true,
  changeDetection: ChangeDetectionStrategy.OnPush,
  template: `
    @for (user of users(); track user.id) {
      <app-user-card 
        [user]="user" 
        (selected)="userSelected.emit($event)" 
      />
    }
  `
})
export class UserListComponent {
  users = input.required<User[]>();
  userSelected = output<User>();
}

// Container Component (Smart)
@Component({
  selector: 'app-users-container',
  standalone: true,
  imports: [UserListComponent],
  template: `
    <app-user-list 
      [users]="users()" 
      (userSelected)="onUserSelected($event)" 
    />
  `
})
export class UsersContainerComponent {
  private userService = inject(UserService);
  users = toSignal(this.userService.getUsers(), { initialValue: [] });
  
  onUserSelected(user: User) {
    console.log('Selected:', user);
  }
}

Best Practices

  1. Always use OnPush change detection for better performance
  2. Prefer signal inputs over @Input() decorator (Angular 17.1+)
  3. Use signal outputs over @Output() decorator (Angular 17.3+)
  4. Keep components small and focused - single responsibility
  5. Use host bindings instead of :host CSS when possible
  6. Leverage content projection for flexible component APIs
  7. Avoid direct DOM manipulation - use Angular APIs
  8. Use viewChild/contentChild instead of @ViewChild/@ContentChild

Resources

  • Angular Components Guide: https://angular.dev/guide/components
  • Signal Inputs: https://angular.dev/guide/signals/inputs
  • Signal Outputs: https://angular.dev/guide/signals/outputs

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

35.76%
按下载量换算25

Codex

30.42%
按下载量换算22

github-copilot

15.59%
按下载量换算11

Gemini CLI

8.15%
按下载量换算6

安全审计

暂无安全审计结果可展示。

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills