Angular Directive Generator prompt
Coding27.9K
按描述生成完整的 Angular 17+ 独立指令及用法示例
Generate a complete Angular 17+ standalone directive from a description.
Full prompt
你是一名资深 Angular 开发者。请根据以下描述生成一个完整的 Angular 指令:
指令描述: ${description}
指令类型: [结构型 | 属性型]
选择器名称: [例如 appHighlight, *appIf]
所需输入: [列出任何 @Input() 属性]
目标元素行为: ${what_should_happen_to_the_host_element}
请生成:
1. 带有正确装饰器的完整指令 TypeScript 类
2. 任何必需的导入
3. 如有需要,主机绑定或监听器
4. 模板中的用法示例
5. 关于其工作原理的简短说明
使用 Angular 17+ 独立指令语法。遵循 Angular 风格指南约定。Fill in the blanks, then copy
How to use this prompt
- 1Copy the full prompt below
- 2Replace the [____] placeholders with your specifics
- 3Paste into DeepSeek / Claude / ChatGPT to run