[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78V9KAM0HB1DK7B14X5P6N5":3,"skill-same:01M78V9KAM0HB1DK7B14X5P6N5":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":14,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":36,"install":37,"resources":50},"01M78V9KAM0HB1DK7B14X5P6N5","angular-directives",null,"Create custom directives in Angular v20+ for DOM manipulation and behavior extension. Use for attribute directives that modify element behavior\u002Fappearance, structural directives for portals\u002Foverlays, and host directives for composition. Triggers on creating reusable DOM behaviors, extending element functionality, or composing behaviors across components. Note - use native @if\u002F@for\u002F@switch for control flow, not custom structural directives.","mfrancime\u002Ftrident-archive","mfrancime","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F577553?v=4","01M75NH5W71WGY7NTS8YQ6VP8G","verzillion_kram","01M75NH5WTX2HBXJZWRP4DGAPK",0,"MIT","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fangular-directives\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fangular-directives\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: angular-directives\ndescription: >-\n  Create custom directives in Angular v20+ for DOM manipulation and behavior\n  extension. Use for attribute directives that modify element\n  behavior\u002Fappearance, structural directives for portals\u002Foverlays, and host\n  directives for composition. Triggers on creating reusable DOM behaviors,\n  extending element functionality, or composing behaviors across components.\n  Note - use native @if\u002F@for\u002F@switch for control flow, not custom structural\n  directives.\nmetadata:\n  category: development\n  source:\n    repository: 'https:\u002F\u002Fgithub.com\u002Fanalogjs\u002Fangular-skills'\n    path: skills\u002Fangular-directives\n    license_path: LICENSE\n---\n\n# Angular Directives\n\nCreate custom directives for reusable DOM manipulation and behavior in Angular v20+.\n\n## Attribute Directives\n\nModify the appearance or behavior of an element:\n\n```typescript\nimport { Directive, input, effect, inject, ElementRef } from '@angular\u002Fcore';\n\n@Directive({\n  selector: '[appHighlight]',\n})\nexport class Highlight {\n  private el = inject(ElementRef\u003CHTMLElement>);\n  \n  \u002F\u002F Input with alias matching selector\n  color = input('yellow', { alias: 'appHighlight' });\n  \n  constructor() {\n    effect(() => {\n      this.el.nativeElement.style.backgroundColor = this.color();\n    });\n  }\n}\n\n\u002F\u002F Usage: \u003Cp appHighlight=\"lightblue\">Highlighted text\u003C\u002Fp>\n\u002F\u002F Usage: \u003Cp appHighlight>Default yellow highlight\u003C\u002Fp>\n```\n\n### Using host Property\n\nPrefer `host` over `@HostBinding`\u002F`@HostListener`:\n\n```typescript\n@Directive({\n  selector: '[appTooltip]',\n  host: {\n    '(mouseenter)': 'show()',\n    '(mouseleave)': 'hide()',\n    '[attr.aria-describedby]': 'tooltipId',\n  },\n})\nexport class Tooltip {\n  text = input.required\u003Cstring>({ alias: 'appTooltip' });\n  position = input\u003C'top' | 'bottom' | 'left' | 'right'>('top');\n  \n  tooltipId = `tooltip-${crypto.randomUUID()}`;\n  private tooltipEl: HTMLElement | null = null;\n  private el = inject(ElementRef\u003CHTMLElement>);\n  \n  show() {\n    this.tooltipEl = document.createElement('div');\n    this.tooltipEl.id = this.tooltipId;\n    this.tooltipEl.className = `tooltip tooltip-${this.position()}`;\n    this.tooltipEl.textContent = this.text();\n    this.tooltipEl.setAttribute('role', 'tooltip');\n    document.body.appendChild(this.tooltipEl);\n    this.positionTooltip();\n  }\n  \n  hide() {\n    this.tooltipEl?.remove();\n    this.tooltipEl = null;\n  }\n  \n  private positionTooltip() {\n    \u002F\u002F Position logic based on this.position() and this.el\n  }\n}\n\n\u002F\u002F Usage: \u003Cbutton appTooltip=\"Click to save\" position=\"bottom\">Save\u003C\u002Fbutton>\n```\n\n### Class and Style Manipulation\n\n```typescript\n@Directive({\n  selector: '[appButton]',\n  host: {\n    'class': 'btn',\n    '[class.btn-primary]': 'variant() === \"primary\"',\n    '[class.btn-secondary]': 'variant() === \"secondary\"',\n    '[class.btn-sm]': 'size() === \"small\"',\n    '[class.btn-lg]': 'size() === \"large\"',\n    '[class.disabled]': 'disabled()',\n    '[attr.disabled]': 'disabled() || null',\n  },\n})\nexport class Button {\n  variant = input\u003C'primary' | 'secondary'>('primary');\n  size = input\u003C'small' | 'medium' | 'large'>('medium');\n  disabled = input(false, { transform: booleanAttribute });\n}\n\n\u002F\u002F Usage: \u003Cbutton appButton variant=\"primary\" size=\"large\">Click\u003C\u002Fbutton>\n```\n\n### Event Handling\n\n```typescript\n@Directive({\n  selector: '[appClickOutside]',\n  host: {\n    '(document:click)': 'onDocumentClick($event)',\n  },\n})\nexport class ClickOutside {\n  private el = inject(ElementRef\u003CHTMLElement>);\n  \n  clickOutside = output\u003Cvoid>();\n  \n  onDocumentClick(event: MouseEvent) {\n    if (!this.el.nativeElement.contains(event.target as Node)) {\n      this.clickOutside.emit();\n    }\n  }\n}\n\n\u002F\u002F Usage: \u003Cdiv appClickOutside (clickOutside)=\"closeMenu()\">...\u003C\u002Fdiv>\n```\n\n### Keyboard Shortcuts\n\n```typescript\n@Directive({\n  selector: '[appShortcut]',\n  host: {\n    '(document:keydown)': 'onKeydown($event)',\n  },\n})\nexport class Shortcut {\n  key = input.required\u003Cstring>({ alias: 'appShortcut' });\n  ctrl = input(false, { transform: booleanAttribute });\n  shift = input(false, { transform: booleanAttribute });\n  alt = input(false, { transform: booleanAttribute });\n  \n  triggered = output\u003CKeyboardEvent>();\n  \n  onKeydown(event: KeyboardEvent) {\n    const keyMatch = event.key.toLowerCase() === this.key().toLowerCase();\n    const ctrlMatch = this.ctrl() ? event.ctrlKey || event.metaKey : !event.ctrlKey && !event.metaKey;\n    const shiftMatch = this.shift() ? event.shiftKey : !event.shiftKey;\n    const altMatch = this.alt() ? event.altKey : !event.altKey;\n    \n    if (keyMatch && ctrlMatch && shiftMatch && altMatch) {\n      event.preventDefault();\n      this.triggered.emit(event);\n    }\n  }\n}\n\n\u002F\u002F Usage: \u003Cbutton appShortcut=\"s\" ctrl (triggered)=\"save()\">Save (Ctrl+S)\u003C\u002Fbutton>\n```\n\n## Structural Directives\n\nUse structural directives for DOM manipulation beyond control flow (portals, overlays, dynamic insertion points). For conditionals and loops, use native `@if`, `@for`, `@switch`.\n\n### Portal Directive\n\nRender content in a different DOM location:\n\n```typescript\nimport { Directive, inject, TemplateRef, ViewContainerRef, OnInit, OnDestroy, input } from '@angular\u002Fcore';\n\n@Directive({\n  selector: '[appPortal]',\n})\nexport class Portal implements OnInit, OnDestroy {\n  private templateRef = inject(TemplateRef\u003Cany>);\n  private viewContainerRef = inject(ViewContainerRef);\n  private viewRef: EmbeddedViewRef\u003Cany> | null = null;\n  \n  \u002F\u002F Target container selector or element\n  target = input\u003Cstring | HTMLElement>('body', { alias: 'appPortal' });\n  \n  ngOnInit() {\n    const container = this.getContainer();\n    if (container) {\n      this.viewRef = this.viewContainerRef.createEmbeddedView(this.templateRef);\n      this.viewRef.rootNodes.forEach(node => container.appendChild(node));\n    }\n  }\n  \n  ngOnDestroy() {\n    this.viewRef?.destroy();\n  }\n  \n  private getContainer(): HTMLElement | null {\n    const target = this.target();\n    if (typeof target === 'string') {\n      return document.querySelector(target);\n    }\n    return target;\n  }\n}\n\n\u002F\u002F Usage: Render modal at body level\n\u002F\u002F \u003Cdiv *appPortal=\"'body'\">\n\u002F\u002F   \u003Cdiv class=\"modal\">Modal content\u003C\u002Fdiv>\n\u002F\u002F \u003C\u002Fdiv>\n```\n\n### Lazy Render Directive\n\nDefer rendering until condition is met (one-time):\n\n```typescript\n@Directive({\n  selector: '[appLazyRender]',\n})\nexport class LazyRender {\n  private templateRef = inject(TemplateRef\u003Cany>);\n  private viewContainer = inject(ViewContainerRef);\n  private rendered = false;\n  \n  condition = input.required\u003Cboolean>({ alias: 'appLazyRender' });\n  \n  constructor() {\n    effect(() => {\n      \u002F\u002F Only render once when condition becomes true\n      if (this.condition() && !this.rendered) {\n        this.viewContainer.createEmbeddedView(this.templateRef);\n        this.rendered = true;\n      }\n    });\n  }\n}\n\n\u002F\u002F Usage: Render heavy component only when tab is first activated\n\u002F\u002F \u003Cdiv *appLazyRender=\"activeTab() === 'reports'\">\n\u002F\u002F   \u003Capp-heavy-reports \u002F>\n\u002F\u002F \u003C\u002Fdiv>\n```\n\n### Template Outlet with Context\n\n```typescript\ninterface TemplateContext\u003CT> {\n  $implicit: T;\n  item: T;\n  index: number;\n}\n\n@Directive({\n  selector: '[appTemplateOutlet]',\n})\nexport class TemplateOutlet\u003CT> {\n  private viewContainer = inject(ViewContainerRef);\n  private currentView: EmbeddedViewRef\u003CTemplateContext\u003CT>> | null = null;\n  \n  template = input.required\u003CTemplateRef\u003CTemplateContext\u003CT>>>({ alias: 'appTemplateOutlet' });\n  context = input.required\u003CT>({ alias: 'appTemplateOutletContext' });\n  index = input(0, { alias: 'appTemplateOutletIndex' });\n  \n  constructor() {\n    effect(() => {\n      const template = this.template();\n      const context = this.context();\n      const index = this.index();\n      \n      if (this.currentView) {\n        this.currentView.context.$implicit = context;\n        this.currentView.context.item = context;\n        this.currentView.context.index = index;\n        this.currentView.markForCheck();\n      } else {\n        this.currentView = this.viewContainer.createEmbeddedView(template, {\n          $implicit: context,\n          item: context,\n          index,\n        });\n      }\n    });\n  }\n}\n\n\u002F\u002F Usage: Custom list with template\n\u002F\u002F \u003Cng-template #itemTemplate let-item let-i=\"index\">\n\u002F\u002F   \u003Cdiv>{{ i }}: {{ item.name }}\u003C\u002Fdiv>\n\u002F\u002F \u003C\u002Fng-template>\n\u002F\u002F \u003Cng-container \n\u002F\u002F   *appTemplateOutlet=\"itemTemplate; context: item; index: i\"\n\u002F\u002F \u002F>\n```\n\n## Host Directives\n\nCompose directives on components or other directives:\n\n```typescript\n\u002F\u002F Reusable behavior directives\n@Directive({\n  selector: '[focusable]',\n  host: {\n    'tabindex': '0',\n    '(focus)': 'onFocus()',\n    '(blur)': 'onBlur()',\n    '[class.focused]': 'isFocused()',\n  },\n})\nexport class Focusable {\n  isFocused = signal(false);\n  \n  onFocus() { this.isFocused.set(true); }\n  onBlur() { this.isFocused.set(false); }\n}\n\n@Directive({\n  selector: '[disableable]',\n  host: {\n    '[class.disabled]': 'disabled()',\n    '[attr.aria-disabled]': 'disabled()',\n  },\n})\nexport class Disableable {\n  disabled = input(false, { transform: booleanAttribute });\n}\n\n\u002F\u002F Component using host directives\n@Component({\n  selector: 'app-custom-button',\n  hostDirectives: [\n    Focusable,\n    {\n      directive: Disableable,\n      inputs: ['disabled'],\n    },\n  ],\n  host: {\n    'role': 'button',\n    '(click)': 'onClick($event)',\n    '(keydown.enter)': 'onClick($event)',\n    '(keydown.space)': 'onClick($event)',\n  },\n  template: `\u003Cng-content \u002F>`,\n})\nexport class CustomButton {\n  private disableable = inject(Disableable);\n  \n  clicked = output\u003Cvoid>();\n  \n  onClick(event: Event) {\n    if (!this.disableable.disabled()) {\n      this.clicked.emit();\n    }\n  }\n}\n\n\u002F\u002F Usage: \u003Capp-custom-button disabled>Click me\u003C\u002Fapp-custom-button>\n```\n\n### Exposing Host Directive Outputs\n\n```typescript\n@Directive({\n  selector: '[hoverable]',\n  host: {\n    '(mouseenter)': 'onEnter()',\n    '(mouseleave)': 'onLeave()',\n    '[class.hovered]': 'isHovered()',\n  },\n})\nexport class Hoverable {\n  isHovered = signal(false);\n  \n  hoverChange = output\u003Cboolean>();\n  \n  onEnter() {\n    this.isHovered.set(true);\n    this.hoverChange.emit(true);\n  }\n  \n  onLeave() {\n    this.isHovered.set(false);\n    this.hoverChange.emit(false);\n  }\n}\n\n@Component({\n  selector: 'app-card',\n  hostDirectives: [\n    {\n      directive: Hoverable,\n      outputs: ['hoverChange'],\n    },\n  ],\n  template: `\u003Cng-content \u002F>`,\n})\nexport class Card {}\n\n\u002F\u002F Usage: \u003Capp-card (hoverChange)=\"onHover($event)\">...\u003C\u002Fapp-card>\n```\n\n## Directive Composition API\n\nCombine multiple behaviors:\n\n```typescript\n\u002F\u002F Base directives\n@Directive({ selector: '[withRipple]' })\nexport class Ripple {\n  \u002F\u002F Ripple effect implementation\n}\n\n@Directive({ selector: '[withElevation]' })\nexport class Elevation {\n  elevation = input(2);\n}\n\n\u002F\u002F Composed component\n@Component({\n  selector: 'app-material-button',\n  hostDirectives: [\n    Ripple,\n    {\n      directive: Elevation,\n      inputs: ['elevation'],\n    },\n    {\n      directive: Disableable,\n      inputs: ['disabled'],\n    },\n  ],\n  template: `\u003Cng-content \u002F>`,\n})\nexport class MaterialButton {}\n```\n\nFor advanced patterns, see [references\u002Fdirective-patterns.md](references\u002Fdirective-patterns.md).\n","# Angular Directives\n\nCreate custom directives for reusable DOM manipulation and behavior in Angular v20+.\n\n## Attribute Directives\n\nModify the appearance or behavior of an element:\n\n```typescript\nimport { Directive, input, effect, inject, ElementRef } from '@angular\u002Fcore';\n\n@Directive({\n  selector: '[appHighlight]',\n})\nexport class Highlight {\n  private el = inject(ElementRef\u003CHTMLElement>);\n  \n  \u002F\u002F Input with alias matching selector\n  color = input('yellow', { alias: 'appHighlight' });\n  \n  constructor() {\n    effect(() => {\n      this.el.nativeElement.style.backgroundColor = this.color();\n    });\n  }\n}\n\n\u002F\u002F Usage: \u003Cp appHighlight=\"lightblue\">Highlighted text\u003C\u002Fp>\n\u002F\u002F Usage: \u003Cp appHighlight>Default yellow highlight\u003C\u002Fp>\n```\n\n### Using host Property\n\nPrefer `host` over `@HostBinding`\u002F`@HostListener`:\n\n```typescript\n@Directive({\n  selector: '[appTooltip]',\n  host: {\n    '(mouseenter)': 'show()',\n    '(mouseleave)': 'hide()',\n    '[attr.aria-describedby]': 'tooltipId',\n  },\n})\nexport class Tooltip {\n  text = input.required\u003Cstring>({ alias: 'appTooltip' });\n  position = input\u003C'top' | 'bottom' | 'left' | 'right'>('top');\n  \n  tooltipId = `tooltip-${crypto.randomUUID()}`;\n  private tooltipEl: HTMLElement | null = null;\n  private el = inject(ElementRef\u003CHTMLElement>);\n  \n  show() {\n    this.tooltipEl = document.createElement('div');\n    this.tooltipEl.id = this.tooltipId;\n    this.tooltipEl.className = `tooltip tooltip-${this.position()}`;\n    this.tooltipEl.textContent = this.text();\n    this.tooltipEl.setAttribute('role', 'tooltip');\n    document.body.appendChild(this.tooltipEl);\n    this.positionTooltip();\n  }\n  \n  hide() {\n    this.tooltipEl?.remove();\n    this.tooltipEl = null;\n  }\n  \n  private positionTooltip() {\n    \u002F\u002F Position logic based on this.position() and this.el\n  }\n}\n\n\u002F\u002F Usage: \u003Cbutton appTooltip=\"Click to save\" position=\"bottom\">Save\u003C\u002Fbutton>\n```\n\n### Class and Style Manipulation\n\n```typescript\n@Directive({\n  selector: '[appButton]',\n  host: {\n    'class': 'btn',\n    '[class.btn-primary]': 'variant() === \"primary\"',\n    '[class.btn-secondary]': 'variant() === \"secondary\"',\n    '[class.btn-sm]': 'size() === \"small\"',\n    '[class.btn-lg]': 'size() === \"large\"',\n    '[class.disabled]': 'disabled()',\n    '[attr.disabled]': 'disabled() || null',\n  },\n})\nexport class Button {\n  variant = input\u003C'primary' | 'secondary'>('primary');\n  size = input\u003C'small' | 'medium' | 'large'>('medium');\n  disabled = input(false, { transform: booleanAttribute });\n}\n\n\u002F\u002F Usage: \u003Cbutton appButton variant=\"primary\" size=\"large\">Click\u003C\u002Fbutton>\n```\n\n### Event Handling\n\n```typescript\n@Directive({\n  selector: '[appClickOutside]',\n  host: {\n    '(document:click)': 'onDocumentClick($event)',\n  },\n})\nexport class ClickOutside {\n  private el = inject(ElementRef\u003CHTMLElement>);\n  \n  clickOutside = output\u003Cvoid>();\n  \n  onDocumentClick(event: MouseEvent) {\n    if (!this.el.nativeElement.contains(event.target as Node)) {\n      this.clickOutside.emit();\n    }\n  }\n}\n\n\u002F\u002F Usage: \u003Cdiv appClickOutside (clickOutside)=\"closeMenu()\">...\u003C\u002Fdiv>\n```\n\n### Keyboard Shortcuts\n\n```typescript\n@Directive({\n  selector: '[appShortcut]',\n  host: {\n    '(document:keydown)': 'onKeydown($event)',\n  },\n})\nexport class Shortcut {\n  key = input.required\u003Cstring>({ alias: 'appShortcut' });\n  ctrl = input(false, { transform: booleanAttribute });\n  shift = input(false, { transform: booleanAttribute });\n  alt = input(false, { transform: booleanAttribute });\n  \n  triggered = output\u003CKeyboardEvent>();\n  \n  onKeydown(event: KeyboardEvent) {\n    const keyMatch = event.key.toLowerCase() === this.key().toLowerCase();\n    const ctrlMatch = this.ctrl() ? event.ctrlKey || event.metaKey : !event.ctrlKey && !event.metaKey;\n    const shiftMatch = this.shift() ? event.shiftKey : !event.shiftKey;\n    const altMatch = this.alt() ? event.altKey : !event.altKey;\n    \n    if (keyMatch && ctrlMatch && shiftMatch && altMatch) {\n      event.preventDefault();\n      this.triggered.emit(event);\n    }\n  }\n}\n\n\u002F\u002F Usage: \u003Cbutton appShortcut=\"s\" ctrl (triggered)=\"save()\">Save (Ctrl+S)\u003C\u002Fbutton>\n```\n\n## Structural Directives\n\nUse structural directives for DOM manipulation beyond control flow (portals, overlays, dynamic insertion points). For conditionals and loops, use native `@if`, `@for`, `@switch`.\n\n### Portal Directive\n\nRender content in a different DOM location:\n\n```typescript\nimport { Directive, inject, TemplateRef, ViewContainerRef, OnInit, OnDestroy, input } from '@angular\u002Fcore';\n\n@Directive({\n  selector: '[appPortal]',\n})\nexport class Portal implements OnInit, OnDestroy {\n  private templateRef = inject(TemplateRef\u003Cany>);\n  private viewContainerRef = inject(ViewContainerRef);\n  private viewRef: EmbeddedViewRef\u003Cany> | null = null;\n  \n  \u002F\u002F Target container selector or element\n  target = input\u003Cstring | HTMLElement>('body', { alias: 'appPortal' });\n  \n  ngOnInit() {\n    const container = this.getContainer();\n    if (container) {\n      this.viewRef = this.viewContainerRef.createEmbeddedView(this.templateRef);\n      this.viewRef.rootNodes.forEach(node => container.appendChild(node));\n    }\n  }\n  \n  ngOnDestroy() {\n    this.viewRef?.destroy();\n  }\n  \n  private getContainer(): HTMLElement | null {\n    const target = this.target();\n    if (typeof target === 'string') {\n      return document.querySelector(target);\n    }\n    return target;\n  }\n}\n\n\u002F\u002F Usage: Render modal at body level\n\u002F\u002F \u003Cdiv *appPortal=\"'body'\">\n\u002F\u002F   \u003Cdiv class=\"modal\">Modal content\u003C\u002Fdiv>\n\u002F\u002F \u003C\u002Fdiv>\n```\n\n### Lazy Render Directive\n\nDefer rendering until condition is met (one-time):\n\n```typescript\n@Directive({\n  selector: '[appLazyRender]',\n})\nexport class LazyRender {\n  private templateRef = inject(TemplateRef\u003Cany>);\n  private viewContainer = inject(ViewContainerRef);\n  private rendered = false;\n  \n  condition = input.required\u003Cboolean>({ alias: 'appLazyRender' });\n  \n  constructor() {\n    effect(() => {\n      \u002F\u002F Only render once when condition becomes true\n      if (this.condition() && !this.rendered) {\n        this.viewContainer.createEmbeddedView(this.templateRef);\n        this.rendered = true;\n      }\n    });\n  }\n}\n\n\u002F\u002F Usage: Render heavy component only when tab is first activated\n\u002F\u002F \u003Cdiv *appLazyRender=\"activeTab() === 'reports'\">\n\u002F\u002F   \u003Capp-heavy-reports \u002F>\n\u002F\u002F \u003C\u002Fdiv>\n```\n\n### Template Outlet with Context\n\n```typescript\ninterface TemplateContext\u003CT> {\n  $implicit: T;\n  item: T;\n  index: number;\n}\n\n@Directive({\n  selector: '[appTemplateOutlet]',\n})\nexport class TemplateOutlet\u003CT> {\n  private viewContainer = inject(ViewContainerRef);\n  private currentView: EmbeddedViewRef\u003CTemplateContext\u003CT>> | null = null;\n  \n  template = input.required\u003CTemplateRef\u003CTemplateContext\u003CT>>>({ alias: 'appTemplateOutlet' });\n  context = input.required\u003CT>({ alias: 'appTemplateOutletContext' });\n  index = input(0, { alias: 'appTemplateOutletIndex' });\n  \n  constructor() {\n    effect(() => {\n      const template = this.template();\n      const context = this.context();\n      const index = this.index();\n      \n      if (this.currentView) {\n        this.currentView.context.$implicit = context;\n        this.currentView.context.item = context;\n        this.currentView.context.index = index;\n        this.currentView.markForCheck();\n      } else {\n        this.currentView = this.viewContainer.createEmbeddedView(template, {\n          $implicit: context,\n          item: context,\n          index,\n        });\n      }\n    });\n  }\n}\n\n\u002F\u002F Usage: Custom list with template\n\u002F\u002F \u003Cng-template #itemTemplate let-item let-i=\"index\">\n\u002F\u002F   \u003Cdiv>{{ i }}: {{ item.name }}\u003C\u002Fdiv>\n\u002F\u002F \u003C\u002Fng-template>\n\u002F\u002F \u003Cng-container \n\u002F\u002F   *appTemplateOutlet=\"itemTemplate; context: item; index: i\"\n\u002F\u002F \u002F>\n```\n\n## Host Directives\n\nCompose directives on components or other directives:\n\n```typescript\n\u002F\u002F Reusable behavior directives\n@Directive({\n  selector: '[focusable]',\n  host: {\n    'tabindex': '0',\n    '(focus)': 'onFocus()',\n    '(blur)': 'onBlur()',\n    '[class.focused]': 'isFocused()',\n  },\n})\nexport class Focusable {\n  isFocused = signal(false);\n  \n  onFocus() { this.isFocused.set(true); }\n  onBlur() { this.isFocused.set(false); }\n}\n\n@Directive({\n  selector: '[disableable]',\n  host: {\n    '[class.disabled]': 'disabled()',\n    '[attr.aria-disabled]': 'disabled()',\n  },\n})\nexport class Disableable {\n  disabled = input(false, { transform: booleanAttribute });\n}\n\n\u002F\u002F Component using host directives\n@Component({\n  selector: 'app-custom-button',\n  hostDirectives: [\n    Focusable,\n    {\n      directive: Disableable,\n      inputs: ['disabled'],\n    },\n  ],\n  host: {\n    'role': 'button',\n    '(click)': 'onClick($event)',\n    '(keydown.enter)': 'onClick($event)',\n    '(keydown.space)': 'onClick($event)',\n  },\n  template: `\u003Cng-content \u002F>`,\n})\nexport class CustomButton {\n  private disableable = inject(Disableable);\n  \n  clicked = output\u003Cvoid>();\n  \n  onClick(event: Event) {\n    if (!this.disableable.disabled()) {\n      this.clicked.emit();\n    }\n  }\n}\n\n\u002F\u002F Usage: \u003Capp-custom-button disabled>Click me\u003C\u002Fapp-custom-button>\n```\n\n### Exposing Host Directive Outputs\n\n```typescript\n@Directive({\n  selector: '[hoverable]',\n  host: {\n    '(mouseenter)': 'onEnter()',\n    '(mouseleave)': 'onLeave()',\n    '[class.hovered]': 'isHovered()',\n  },\n})\nexport class Hoverable {\n  isHovered = signal(false);\n  \n  hoverChange = output\u003Cboolean>();\n  \n  onEnter() {\n    this.isHovered.set(true);\n    this.hoverChange.emit(true);\n  }\n  \n  onLeave() {\n    this.isHovered.set(false);\n    this.hoverChange.emit(false);\n  }\n}\n\n@Component({\n  selector: 'app-card',\n  hostDirectives: [\n    {\n      directive: Hoverable,\n      outputs: ['hoverChange'],\n    },\n  ],\n  template: `\u003Cng-content \u002F>`,\n})\nexport class Card {}\n\n\u002F\u002F Usage: \u003Capp-card (hoverChange)=\"onHover($event)\">...\u003C\u002Fapp-card>\n```\n\n## Directive Composition API\n\nCombine multiple behaviors:\n\n```typescript\n\u002F\u002F Base directives\n@Directive({ selector: '[withRipple]' })\nexport class Ripple {\n  \u002F\u002F Ripple effect implementation\n}\n\n@Directive({ selector: '[withElevation]' })\nexport class Elevation {\n  elevation = input(2);\n}\n\n\u002F\u002F Composed component\n@Component({\n  selector: 'app-material-button',\n  hostDirectives: [\n    Ripple,\n    {\n      directive: Elevation,\n      inputs: ['elevation'],\n    },\n    {\n      directive: Disableable,\n      inputs: ['disabled'],\n    },\n  ],\n  template: `\u003Cng-content \u002F>`,\n})\nexport class MaterialButton {}\n```\n\nFor advanced patterns, see [references\u002Fdirective-patterns.md](references\u002Fdirective-patterns.md).\n",{"name":5,"metadata":25,"description":7},{"source":26,"category":30},{"path":27,"repository":28,"license_path":29},"skills\u002Fangular-directives","https:\u002F\u002Fgithub.com\u002Fanalogjs\u002Fangular-skills","LICENSE","development","main","cef85894d3d9a4c9dabe5a90887d5ac59fe4ff0f","repos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fangular-directives","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive","https:\u002F\u002Fgithub.com\u002Fmfrancime","2026-09-11 19:19:01",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add mfrancime\u002Ftrident-archive --skill angular-directives",{"tool":43,"command":44},"bunx","bunx skills add mfrancime\u002Ftrident-archive --skill angular-directives",{"tool":46,"command":47},"pnpm","pnpm dlx skills add mfrancime\u002Ftrident-archive --skill angular-directives","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fangular-directives\u002FSKILL.md",true,[51,54],{"path":29,"resourceType":29,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":16},"许可证",1072,{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fdirective-patterns.md","REFERENCE","参考文档",12849,"https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fangular-directives\u002Freferences\u002Fdirective-patterns.md",[61,70,78,86,93,100],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":65,"licenseFileUrl":66,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":20},"01M78VKWV0YXDY47JW2S4M19R1","skill-creator","Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_orcaclaw_sakana_personal_ai_assistant\u002Fskills\u002Fskill-creator\u002Flicense.txt","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_orcaclaw_sakana_personal_ai_assistant\u002Fskills\u002Fskill-creator\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":74,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":20},"01M78VGSK0VQR8DFB181VS4MN8","prose","OpenProse VM skill pack. Activate on any `prose` command, .prose files, or OpenProse mentions; orchestrates multi-agent workflows.","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_orcaclaw_sakana_personal_ai_assistant\u002Fextensions\u002Fopen-prose\u002Fskills\u002Fprose\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_orcaclaw_sakana_personal_ai_assistant\u002Fextensions\u002Fopen-prose\u002Fskills\u002Fprose\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":65,"licenseFileUrl":82,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":20},"01M78VFJ4N00J9RMF7X5AVZY7C","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fwebapp-testing\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":20},"01M78VF9C8TQ37WGS6WBT77BVW","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fvercel-react-best-practices\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":20},"01M78VF5VFD2CA77AM9AVBXR7C","vercel-deploy","Deploy applications and websites to Vercel. Use this skill when the user requests deployment actions such as \"Deploy my app\", \"Deploy this to production\", \"Create a preview deployment\", \"Deploy and give me the link\", or \"Push this live\". No authentication required - returns preview URL and claimable deployment link.","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fvercel-deploy\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":20},"01M78VF0JF37J4KCM4Y30Z9E55","vercel-composition-patterns","React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.","https:\u002F\u002Fgithub.com\u002Fmfrancime\u002Ftrident-archive\u002Fblob\u002Fmain\u002Frepos\u002Ftrident_kilo-marketplace_skills_mcp_catalog\u002Fskills\u002Fvercel-composition-patterns\u002FSKILL.md",[],[]]