Skip to content

Angular 19 - Signal Inputs and Web Components routed vs page load #59757

@vickieallen-certua

Description

@vickieallen-certua

Which @angular/* package(s) are the source of the bug?

elements

Is this a regression?

Yes

Description

We are experiencing an issue with input signals in a web component. When navigating to a page containing the web component via routing, the input signals are set correctly. However, if the page is reloaded directly (e.g., by refreshing the browser), the input signals are not initialized as expected.

Switching from input() to @input resolves the issue. Below is a reproduction of the problem:

Steps to Reproduce:
Run the app and web component server as outlined in the README.
Navigate to http://localhost:5500/.
Click on "Go to Counter".
Observe that the initial values are correctly set to 5 and 10.
Refresh the browser.
Notice that the initial values revert to 0.
This behavior occurs for various input types, including booleans, objects, and numbers.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/~/github.com/vickieallen-certua/angular-input-signals-web-components

Please provide the exception or error you saw


Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 19.1.4
Node: 18.20.3
Package Manager: npm 10.2.3
OS: linux x64

Angular: 19.1.3
... animations, common, compiler, compiler-cli, core, elements
... forms, platform-browser, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.4
@angular-devkit/build-angular   19.1.4
@angular-devkit/core            19.1.4
@angular-devkit/schematics      19.1.4
@angular/cli                    19.1.4
@schematics/angular             19.1.4
rxjs                            7.8.1
typescript                      5.5.4
zone.js                         0.15.0

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: elementsIssues related to Angular Elements

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions