Tools•generator
Angular CLI for Angular
Generates boilerplate code for converting module-based Angular components into standalone components with required imports and decorators
Try the tool
client runnerGenerated component code
Run the tool to see output.
Examples
Basic standalone component
{
"component_name": "UserProfile",
"module_name": "AppModule",
"include_imports": true
}Expected output
import { Component } from '@angular/core';
@Component({
selector: 'app-user-profile',
template: '<div>User Profile</div>'
})
export class UserProfileComponent { }Standalone component without imports
{
"component_name": "Dashboard",
"module_name": "FeaturesModule",
"include_imports": false
}Expected output
@Component({
selector: 'app-dashboard',
template: '<div>Dashboard</div>'
})
export class DashboardComponent { }How it works
Analyzes component and module relationships to generate standalone component decorators and import statements. Automatically handles Angular 14+ standalone syntax requirements.