-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[Migration issue Angular 18 -> 19] toObservable is executed too early and I can't access .required inputs from deffered children #60804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think it could be duplicate of: |
Yep, exactly let's fold the discussion with the other issue. Also, we're curious why are you reaching for |
@JeanMeche Hmmm. Why I shouldn't? I just wanna to get the moment of the collection change and when is ready to get the properties from them. Llike in example I wrote above: private readonly children = contentChildren(ChildComponent);
constructor() {
this.handleItemsValue();
}
private handleItemsValue(): void {
toObservable(this.children).subscribe(children => {
const values = this.children.map(x => x.value()); // Error
saveValuesInLocalStorage(values);
});
} How I can write this different? In v18 everyting works fine and the all behaviors was predictable, like other members wrote. Due to this change we stuck on 18, because this behaviors is too big breaking-changes and half of application logic need to be changed - but for now we're not sure how to make it properly. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Uh oh!
There was an error while loading. Please reload this page.
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
Yes
Description
Hello,
I'm facing issues with
toObservable
while migrating angular v18 app to v19.2.5.When content children is loaded deffered, toObservable throws errors while accessing to
model
required properties.Component HTML where is everyting working:
Deffered loading component:
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-x2fxd5yb?file=src%2Fmain.ts
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
This is causing problems with handling events. For example, we can't do things like that:
The text was updated successfully, but these errors were encountered: