Angular Signal Inputs Converter
Paste a component and convert @Input, @Output, @ViewChild and @ContentChildren to input(), output(), model() and viewChild(), with this.x and template reads updated to x(), using the official migration rules.
Loading the converter…From Decorators to Signals
Since Angular 19, a component can declare its inputs, outputs and queries with functions instead of decorators: input(), output(), model(), viewChild() and their siblings. Inputs and queries become signals, so you read them by calling them (this.user(), {{ user() }}) and they work in computed() and effect() without ngOnChanges. Paste a component above and the converter rewrites the declarations, adds the calls in the class, the inline template and host bindings, updates the imports, and lists anything it left alone.
Decorator to Signal Cheat Sheet
| Decorator | Signal API |
|---|---|
| @Input() name: string; | readonly name = input<string>(); |
| @Input() label = 'Member'; | readonly label = input('Member'); |
| @Input({ required: true }) user!: User; | readonly user = input.required<User>(); |
| @Input('cardSize') size = 'sm'; | readonly size = input('sm', { alias: 'cardSize' }); |
| @Input({ transform: booleanAttribute }) disabled = false; | readonly disabled = input(false, { transform: booleanAttribute }); |
| @Input() value + @Output() valueChange | readonly value = model(0); |
| @Output() saved = new EventEmitter<Item>(); | readonly saved = output<Item>(); |
| @ViewChild('ref') el?: ElementRef; | readonly el = viewChild<ElementRef>('ref'); |
| @ViewChild('ref', { static: true }) el!: ElementRef; | readonly el = viewChild.required<ElementRef>('ref'); |
| @ViewChildren(Item) items!: QueryList<Item>; | readonly items = viewChildren(Item); |
| @ContentChild(Tpl, { read: TemplateRef }) tpl?; | readonly tpl = contentChild(Tpl, { read: TemplateRef }); |
| @ContentChildren(Tab, { descendants: true }) tabs; | readonly tabs = contentChildren(Tab, { descendants: true }); |
| this.name / {{ name }} | this.name() / {{ name() }} |
| this.items.toArray() / .first / .last | this.items() / ()[0] / ().at(-1) |
| this.saved.next(x) / .complete() | this.saved.emit(x) / removed |
| this.value = v; this.valueChange.emit(v); | this.value.set(v); |
Migrating a Whole Project
The Angular CLI ships the same conversions as schematics. Commit first, run one, then review the diff and the TODO comments.
- 1
Everything at once
Runs the input, output and query migrations together. The CLI asks which ones to run.
ng generate @angular/core:signals - 2
Inputs only
Add --insert-todos to get a comment on every input it skips, and --best-effort-mode to migrate more at the risk of build errors.
ng generate @angular/core:signal-input-migration --insert-todos - 3
Outputs only
Converts EventEmitter outputs, renames .next() to .emit() and removes .complete() calls.
ng generate @angular/core:output-migration - 4
Queries only
Converts @ViewChild, @ViewChildren, @ContentChild and @ContentChildren.
ng generate @angular/core:signal-queries-migration --insert-todos
Frequently Asked Questions
- Are signal inputs, outputs and queries stable?
- Yes. input(), model(), output() and the signal query functions have been production ready since Angular 19, and they are the recommended style in Angular 22. The decorators still work and are not deprecated, so you can migrate one component at a time.
- Should I use this converter or ng generate @angular/core:signals?
- For a whole project, run the official migration: it sees every file, so it can also update parents, tests and host bindings that touch an input. This converter is for one component at a time: previewing what the migration will do, converting a file in a project you cannot run the CLI in, or learning the new APIs. It follows the same rules and keeps your formatting, because it only rewrites the code it converts.
- Why are some inputs skipped?
- input() is read-only, so an input that the class or its template assigns to (this.page = 2, or [(ngModel)]="page") cannot become one. Setter inputs, inputs with another decorator such as @HostBinding, and outputs that are subscribed to or piped are skipped as well, exactly as the official migration skips them. With "Insert TODO comments" on, each skipped member gets the same "TODO: Skipped for migration because" comment the migration writes.
- When does an input become model()?
- When the "Combine into model()" option is on and a component has @Input() value next to @Output() valueChange. That pair is how two-way binding worked before signals, and model() replaces both. Writes become value.set(), and valueChange.emit(this.value) after a write is removed because set() already emits. The official migrations do not do this step, so turn it off to match them exactly.
- Why does the converter add const name = this.name()?
- TypeScript narrows this.name after if (this.name), but it cannot narrow a call such as this.name(). Like the official migration, the converter reads the signal once into a local before the check and uses the local inside it, so code like if (this.panel) { this.panel.nativeElement… } keeps compiling.
- What happens to @ViewChild with static: true?
- Signal queries have no static option, so it is dropped: the signal updates as soon as the result is available. A query declared with ! becomes viewChild.required(), which throws a clear error if it is read before the element exists instead of returning undefined.
- What else do I need to change by hand?
- Code outside the component. Tests that set an input directly need fixture.componentRef.setInput(), and parents that read a child input through a query need to call it. If the component uses templateUrl, paste the template in the Template tab so its references get () too.
- Is my code uploaded anywhere?
- No. The conversion runs entirely in your browser.
Sources & Official Resources
The conversion rules follow Angular's signal input, output and query migrations. Last reviewed against Angular 22.2, and the examples were type-checked with the Angular 22 compiler in strict template mode.
- Migration to signal inputs (angular.dev)
- Migration to output function (angular.dev)
- Migration to signal queries (angular.dev)
- Accepting data with input properties (angular.dev)
- Custom events with outputs (angular.dev)
- Referencing component children with queries (angular.dev)
Modernizing templates too? The Control Flow Converter rewrites *ngIf and *ngFor, and the Angular Upgrade Planner lists every step between two versions. More in Angular tools.