Description
Which @angular/* package(s) are the source of the bug?
router
Is this a regression?
No
Description
When I use withComponentInputBinding with a component which has a default input value, I expect that if the input is not defined is the route data then the default input value is kept.
Actually, If a component has an input with a default value and this input has no correspondance into route data then the result will be undefined. Not my default value.
withComponentInputBinding is here to make more reusable components. So I should be able to defined default input values.
In my given example :
I have a route with my component and a route data defined for my input -> OK the value from route is used.
I have an other route with my component and no route data defined for my input -> KO value is undefined not my default value.
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/mxxufqec-w8znnn3t?file=package.json
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run ng version
)
Angular CLI: 19.0.7
Node: 20.19.1
Package Manager: npm 10.8.2
OS: linux x64
Angular: 19.1.0
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1900.7
@angular-devkit/build-angular 19.0.7
@angular-devkit/core 19.0.7
@angular-devkit/schematics 19.0.7
@angular/cli 19.0.7
@schematics/angular 19.0.7
rxjs 7.8.1
typescript 5.6.3
zone.js 0.15.0
Anything else?
No response