0 day streak
javascript / intermediate
Snippet

Component Input Binding for Routes

Enabling 'withComponentInputBinding' allows Angular to automatically map route parameters, query parameters, and static data directly to component @Input properties, removing the need to manually subscribe to ActivatedRoute.

snippet.js
javascript
1
provideRouter(routes, withComponentInputBinding())
angular
Breakdown
1
provideRouter(routes,
Sets up the router with the provided route definitions.
2
withComponentInputBinding()
Enables the feature that bridges route data directly to component inputs.