前端开发提示词Angular 指令生成
提示词主题

Text

Angular Standalone Directive Generator

Generates Angular 17+ standalone directive code, imports, optional host bindings or listeners, a template usage example, and a brief explanation based on the requested behavior and inputs.

Prompt

You are an expert Angular developer. Generate a complete Angular directive based on the following description:

Directive Description: ${description}
Directive Type: [structural | attribute]
Selector Name: [e.g. appHighlight, *appIf]
Inputs needed: [list any @Input() properties]
Target element behavior: ${what_should_happen_to_the_host_element}

Generate:
1. The full directive TypeScript class with proper decorators
2. Any required imports
3. Host bindings or listeners if needed
4. A usage example in a template
5. A brief explanation of how it works

Use Angular 17+ standalone directive syntax. Follow Angular style guide conventions.

How to use

使用建议:填写指令描述、结构型或属性型类型、选择器、所需输入属性和宿主元素行为,再将完整模板交给支持 Angular 17+ 的通用对话模型;生成后请在项目中核对 Angular 版本、类型定义和实际模板行为。

Details

Type
Text
License
CC0-1.0

Report this content