Angular Components
ASecurityDeclare a required signal input with `input.required<T>()`. Angular will require the parent to bind it, and the component reads the current value by calling the signal, for example `userId()` rather than `userId`. ```ts import { booleanAttribute, ChangeDetectionStrategy, Component, input, } from '@angular/core'; @Component({ selector: 'app-user-badge', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: ` <span [attr.data-user-id]="userId()" [attr.aria-di...
- 584 stars
- 0 votes
- 0 copies
- 6 views
- Added September 5, 2026
Security analysis
100/100Pro scans all 21 files and shows the line behind each finding
npx -y skills add HoangNguyen0403/agent-skills-standard --skill angular-components --agent claude-codeAre you the author of Angular Components?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-angular-components-6269df51)# Using signal inputs with `input.required()`
Declare a required signal input with `input.required<T>()`. Angular will require the parent to bind it, and the component reads the current value by calling the signal, for example `userId()` rather than `userId`.
```ts
import {
booleanAttribute,
ChangeDetectionStrategy,
Component,
input,
} from '@angular/core';
@Component({
selector: 'app-user-badge',
standalone: true,
imports: [],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<span
[attr.data-user-id]="userId()"
[attr.aria-disabled]="disabled()"
>
User {{ userId() }}
</span>
`,
})
export class UserBadgeComponent {
readonly userId = input.required<string>();
readonly disabled = input(false, { transform: booleanAttribute });
}
```
The parent supplies the required value with normal property binding:
```html
<app-user-badge [userId]="selectedUserId" disabled />
```
Use `input<T>(defaultValue)` for optional inputs with a default. Input transforms such as `booleanAttribute` or `numberAttribute` normalize attribute values at the boundary. Signal inputs are read-only from the child; if the child needs to communicate a change, expose an `output()` or `model()` instead of mutating the input.
Files in this skill
- eval-1.baseline.md
- eval-1.with-skill.md
- eval-2.baseline.md
- eval-2.with-skill.md
- eval-3.baseline.md
- eval-3.with-skill.md
- eval-4.baseline.md
- eval-4.with-skill.md
- eval-5.baseline.md
- eval-5.with-skill.md
- eval-6.baseline.md
- eval-6.with-skill.md
- eval-7.baseline.md
- eval-7.with-skill.md
- eval-8.baseline.md
- eval-8.with-skill.md
- eval-9.baseline.md
- eval-9.with-skill.md
- trigger-1.md
- trigger-2.md
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.