一键导入
angular-performance
Angular performance: NgOptimizedImage, @defer, lazy loading, SSR. Trigger: When optimizing Angular app performance, images, or lazy loading.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Angular performance: NgOptimizedImage, @defer, lazy loading, SSR. Trigger: When optimizing Angular app performance, images, or lazy loading.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Lucy-ai's own agent ecosystem installer, updater, and verifier. Use this skill when: - Installing lucy-agent on a new OpenClaw instance - Updating lucy-agent in-place - Verifying the lucy-agent installation - Understanding the lucy-agent structure
Angular architecture: Scope Rule, project structure, file naming, style guide. Trigger: When structuring Angular projects or deciding where to place components.
Angular core patterns: standalone components, signals, inject, control flow, zoneless. Trigger: When creating Angular components, using signals, or setting up zoneless.
Angular forms: Signal Forms (experimental) and Reactive Forms. Trigger: When working with forms, validation, or form state in Angular.
OWASP Top 10 2025 security guidance for ZENTICALAB. Broken Access Control, Cryptographic Failures, Injection, and more — mapped to .NET + Angular.
Comprehensive PR review skill for ZENTICALAB projects (.NET backend + Angular frontend). Use when reviewing pull requests, checking code quality, or validating implementations against spec. Loaded automatically when reviewing PRs in ZENTICALAB repos.
基于 SOC 职业分类
| name | angular-performance |
| description | Angular performance: NgOptimizedImage, @defer, lazy loading, SSR. Trigger: When optimizing Angular app performance, images, or lazy loading. |
| metadata | {"author":"gentleman-programming","version":"1.0"} |
import { NgOptimizedImage } from '@angular/common';
@Component({
imports: [NgOptimizedImage],
template: `
<!-- inline for docs brevity; use templateUrl in production -->
<!-- LCP image: add priority -->
<img ngSrc="hero.jpg" width="800" height="400" priority>
<!-- Regular: lazy loaded by default -->
<img ngSrc="thumb.jpg" width="200" height="200">
<!-- Fill mode (parent needs position: relative) -->
<img ngSrc="bg.jpg" fill>
<!-- With placeholder -->
<img ngSrc="photo.jpg" width="400" height="300" placeholder>
`
})
width and height (or fill)priority to LCP (Largest Contentful Paint) imagengSrc not srcfill image must have position: relative/fixed/absolute@defer (on viewport) {
<heavy-component />
} @placeholder {
<p>Placeholder shown immediately</p>
} @loading (minimum 200ms) {
<spinner />
} @error {
<p>Failed to load</p>
}
| Trigger | When to Use |
|---|---|
on viewport | Below the fold content |
on interaction | Load on click/focus/hover |
on idle | Load when browser is idle |
on timer(500ms) | Load after delay |
when condition | Load when expression is true |
<!-- Multiple triggers -->
@defer (on viewport; on interaction) {
<comments />
}
<!-- Conditional -->
@defer (when showComments()) {
<comments />
}
// Single component
{
path: 'admin',
loadComponent: () => import('./features/admin/admin').then(c => c.AdminComponent)
}
// Feature with child routes
{
path: 'users',
loadChildren: () => import('./features/users/routes').then(m => m.USERS_ROUTES)
}
bootstrapApplication(AppComponent, {
providers: [
provideClientHydration()
]
});
| Scenario | Use |
|---|---|
| SEO critical (blog, e-commerce) | SSR |
| Dashboard/Admin | CSR |
| Static marketing site | SSG/Prerender |
| Solution | When |
|---|---|
| Optimize algorithm | First choice always |
| Pure pipes | Cache single result |
| Memoization | Cache multiple results |
computed() | Derived signal state |
NEVER trigger reflows/repaints in lifecycle hooks (ngOnInit, ngAfterViewInit).