| name | add-component |
| description | Creates a new Angular standalone component with the HTML template wrapped in a <section> element |
add-component
Creates a new Angular standalone component.
When to use
When the user asks to create, add, or generate a new Angular component.
Instructions
- Determine the component name and target directory from the user's request.
- Generate the component file (
<name>.component.ts) as a standalone Angular component.
- Wrap the HTML template in a
<section> element as the root element.
- Use this template structure:
@Component({
selector: 'app-<name>',
standalone: true,
imports: [],
template: `
<section>
<!-- component content here -->
</section>
`,
})
export class <Name>Component {}
- Place the file in the appropriate directory based on the user's request or project conventions.
- Report the created file path to the user.