Enables Angular routing to assign route values directly to matching component input properties, removing the need to read them through ActivatedRoute. Inputs are populated before ngOnInit runs, so initialization logic can consume the assigned values. section 24.3.2
Enable route-to-input binding
Configure the router with RouterModule.forRoot(routes, { bindToComponentInputs: true }). A route such as { path: "form/:mode/:id", component: FormComponent } then supplies mode and id to matching @Input() properties. FormComponent can set editing from mode and parse id before loading the selected product.
Account for the practical behavior of the binding:
- Route values arrive as strings, so boolean and numeric component state requires explicit conversion. section 24.3.2
- The feature changes how values are extracted, not the application’s behavior. section 24.3.2
