I’m using the new Angular Signals API (Angular 17+), where inputs and outputs are declared with the input() and output() functions instead of the classic @Input() / @Output() decorators.
When designing reusable components, I have two ways to define configuration:
@Component({...})
export class AuthForm {
public readonly title = input.required();
public readonly description = input();
public readonly errorText = input();
}
@Component({...})
export class AuthForm {
public readonly config = input.required<{
title: string;
description?: string;
errorText?: string;
}>();
}
The second version feels cleaner and easier to manage, especially for complex components, but I’m not sure if it’s a good practice.
Questions:
Is it considered bad practice in Angular (Signals API) to pass all configuration through a single
configsignal object?Are there potential downsides related to change detection, reactivity, or type safety compared to multiple separate
input()signals?