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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
In Ivy, @Input setting order no longer matches the order of their corresponding properties in the class #34322
Comments
|
I doubt that this was ever intentional, by-design behavior. This sounds like xkcd 1172 to me. |
|
Lol, maybe or maybe not. That's why this issue is filed to dispel our doubts. |
yeah that's a good catch. I'll look at the calling order after the lifecycle methods to see in which order they are accessed because they seem reversed now. Is this behaviour consistent? |
|
Possibly related to https://github.com/angular/angular/blob/master/aio/content/guide/ivy-compatibility.md#changes-you-may-see:
|
|
Hmmm... hopefully I won鈥檛 see same code in my life:) |
|
Please share with us, or just me, a use case in which the order your inputs get called SHOULD matter... |
|
@Shijir To answer your question, we don't consider input setting order within directives to be public API. If you want to react to a directive's inputs in a certain order, using the |
|
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. |
馃悶 bug report
Affected Package
The issue is caused by package "@angular/core": "9.0.0-rc.5" with IvyDescription
Before Ivy:
it was possible to receive
@inputvalues in a certain order. For example: I have a following component:In this case, the
firstNameinput setter used to run before thelastNameinput setter as their order is defined in the component class. So no matter in what order users provide values to input properties, it was possible to receive them in our desired order:After Ivy:
I realized that input values are set as they are provided in the template, not by the order of their corresponding properties in the class. For example, using the exact same component in Ivy, we get the following result:
馃敩 Minimal Reproduction
Angular 8: https://stackblitz.com/edit/angular-input-order
In Ivy: https://ivy.ng-run.com/edit/cOAOZzmer5154DINiEZT?open=app%2Fapp.component.ts
馃實 Your Environment
Angular Version:
Anything else relevant?
The text was updated successfully, but these errors were encountered: