| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| } | ||
| } | ||
|
|
||
| view.create.prepend(generateVariablesInScopeForView(view, scope, false)); |
There was a problem hiding this comment.
This is potentially problematic for variables which aren't available in the creation pass, e.g. @if (c) { <input #i /> <FancyButton [x]="i" /> }
Sorry, something went wrong.
There was a problem hiding this comment.
This is a great catch, and one that isn't trivial to solve. The issue is that these references truly aren't available until the update phase, so we can't simply expose them to the create phase like we did for the component context.
As a workaround, you could use viewQuery() signal to pass reactive references, although this similarly breaks if you use viewQuery.required().
We could implement diagnostics to prohibit passing references in this manner. Alternatively, we could reevaluate the timing of foreign component creation and move it to the update phase. That would be a pretty significant refactor though, so are you okay if we submit this as-is for now and address that in a follow up PR?
Sorry, something went wrong.
…n component When a control flow block (`@if`, `@switch`, `@for`) contains a single root element that is a foreign component, do not treat its name as a tag name for the template container (`conditionalCreate`, `repeaterCreate`).
Prepend generated view scope variables to `view.create` in addition to `view.update` so that expressions evaluated during creation (such as foreign component property bindings) can resolve context variables from parent views when nested inside control flow blocks (`@if`, `@switch`, `@for`). This is necessary to support binding properties to foreign components inside control flow blocks. reflect this broader behavior.)
|
This PR was merged into the repository. The changes were merged into the following branches:
|
Sorry, something went wrong.
…69674) Prepend generated view scope variables to `view.create` in addition to `view.update` so that expressions evaluated during creation (such as foreign component property bindings) can resolve context variables from parent views when nested inside control flow blocks (`@if`, `@switch`, `@for`). This is necessary to support binding properties to foreign components inside control flow blocks. reflect this broader behavior.) PR Close #69674
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Prepend generated view scope variables to view.create in addition to view.update so that expressions evaluated during creation (such as foreign component property bindings) can resolve context variables from parent views when nested inside control flow blocks (@if, @switch, @for). This is necessary to support binding properties to foreign components inside control flow blocks.