fix(compiler): correctly intercept index in loop tracking function#53604
fix(compiler): correctly intercept index in loop tracking function#53604crisbeto wants to merge 1 commit intoangular:mainfrom
Conversation
The for loop tracking function doesn't allow references to local template variables, aside from `$index` and the item which are passed in as parameters. We enforce this by rewriting all variable references to the components scope. The problem is that the logic that rewrites the references first walks the view tree and then checks if the variable is `$index` or the item. This is problematic in nested for loops, because it'll find the `$index` of the parent. These changes resolve the issue by checking for `$index` and the item first. Fixes angular#53600.
|
This PR was merged into the repository by commit 3a689c2. |
…53604) The for loop tracking function doesn't allow references to local template variables, aside from `$index` and the item which are passed in as parameters. We enforce this by rewriting all variable references to the components scope. The problem is that the logic that rewrites the references first walks the view tree and then checks if the variable is `$index` or the item. This is problematic in nested for loops, because it'll find the `$index` of the parent. These changes resolve the issue by checking for `$index` and the item first. Fixes #53600. PR Close #53604
|
/** The translation of your request from Chinese to English is: "Due to the presence of '\n', using native-federation fails. Please assist in fixing this bug." |
…ngular#53604) The for loop tracking function doesn't allow references to local template variables, aside from `$index` and the item which are passed in as parameters. We enforce this by rewriting all variable references to the components scope. The problem is that the logic that rewrites the references first walks the view tree and then checks if the variable is `$index` or the item. This is problematic in nested for loops, because it'll find the `$index` of the parent. These changes resolve the issue by checking for `$index` and the item first. Fixes angular#53600. PR Close angular#53604
…ngular#53604) The for loop tracking function doesn't allow references to local template variables, aside from `$index` and the item which are passed in as parameters. We enforce this by rewriting all variable references to the components scope. The problem is that the logic that rewrites the references first walks the view tree and then checks if the variable is `$index` or the item. This is problematic in nested for loops, because it'll find the `$index` of the parent. These changes resolve the issue by checking for `$index` and the item first. Fixes angular#53600. PR Close angular#53604
…ngular#53604) The for loop tracking function doesn't allow references to local template variables, aside from `$index` and the item which are passed in as parameters. We enforce this by rewriting all variable references to the components scope. The problem is that the logic that rewrites the references first walks the view tree and then checks if the variable is `$index` or the item. This is problematic in nested for loops, because it'll find the `$index` of the parent. These changes resolve the issue by checking for `$index` and the item first. Fixes angular#53600. PR Close angular#53604
|
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. |


The for loop tracking function doesn't allow references to local template variables, aside from
$indexand the item which are passed in as parameters. We enforce this by rewriting all variable references to the components scope.The problem is that the logic that rewrites the references first walks the view tree and then checks if the variable is
$indexor the item. This is problematic in nested for loops, because it'll find the$indexof the parent.These changes resolve the issue by checking for
$indexand the item first.Fixes #53600.