docs: make parent finder functions compatible with AoT (#28592)
PR Close #28592
This commit is contained in:
parent
19f13b1ad4
commit
05a14f8a8b
@ -19,20 +19,20 @@ const DifferentParent = Parent;
|
|||||||
// #enddocregion provide-the-parent
|
// #enddocregion provide-the-parent
|
||||||
// The `parentType` defaults to `Parent` when omitting the second parameter.
|
// The `parentType` defaults to `Parent` when omitting the second parameter.
|
||||||
// #docregion provide-the-parent
|
// #docregion provide-the-parent
|
||||||
const provideParent =
|
export function provideParent
|
||||||
// #enddocregion provide-parent, provide-the-parent
|
// #enddocregion provide-parent, provide-the-parent
|
||||||
// #docregion provide-parent
|
// #docregion provide-parent
|
||||||
(component: any, parentType?: any) => {
|
(component: any, parentType?: any) {
|
||||||
return { provide: parentType || Parent, useExisting: forwardRef(() => component) };
|
return { provide: parentType || Parent, useExisting: forwardRef(() => component) };
|
||||||
};
|
}
|
||||||
// #enddocregion provide-parent
|
// #enddocregion provide-parent
|
||||||
|
|
||||||
// Simpler syntax version that always provides the component in the name of `Parent`.
|
// Simpler syntax version that always provides the component in the name of `Parent`.
|
||||||
const provideTheParent =
|
export function provideTheParent
|
||||||
// #docregion provide-the-parent
|
// #docregion provide-the-parent
|
||||||
(component: any) => {
|
(component: any) {
|
||||||
return { provide: Parent, useExisting: forwardRef(() => component) };
|
return { provide: Parent, useExisting: forwardRef(() => component) };
|
||||||
};
|
}
|
||||||
// #enddocregion provide-the-parent
|
// #enddocregion provide-the-parent
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user