Our team is making a transition in the Dependency Injection pattern we utilize to minimize the dependency on TypeScript constructors. This shift will help us address recurring issues caused by team members adding logic that shouldn't be included in constructors.
We are able to easily make the switch from this conventional pattern:
constructor(private readonly fb: FormBuilder) {}
to this more efficient approach:
private readonly fb = inject(FormBuilder);
However, we encountered challenges when attempting to refactor the following code out of constructors:
constructor(@Inject(MAT_DIALOG_DATA) public data: string ) {}
We are seeking suggestions or solutions on how to achieve this restructuring without the need for constructors. Any ideas?