mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
555fc20af0
Enable foreign components to receive and propagate contextual data across framework boundaries. Previously, foreign render functions only accepted component properties, and foreign content projection instructions (`ɵɵforeignContent` / `ɵɵforeignContentFn`) did not provide any mechanism to expose foreign framework context to projected Angular embedded views. With this change: - Update `ForeignRenderFn` and `ForeignComponent` interfaces to accept an optional context parameter and an optional `GET_CONTEXT` symbol method. - Introduce `FOREIGN_CONTEXT` injection token and `provideForeignRootContext` helper to configure root context in Angular's DI hierarchy. - Update `ɵɵforeignComponent` instruction to resolve `FOREIGN_CONTEXT` from the injection tree and pass it to the foreign component's render function. - Update `ɵɵforeignContent` and `ɵɵforeignContentFn` instructions to wrap embedded view creation with a `ForeignContextInjector` when `GET_CONTEXT` is present. Furthermore, foreign render functions are no longer run inside an Angular injection context, since it's expected they use the foreign context support directly. PR Close #69502