docs: make parent finder functions compatible with AoT (#28592)

PR Close #28592
This commit is contained in:
Brandon 2019-02-07 14:58:04 +00:00 committed by Miško Hevery
parent 19f13b1ad4
commit 05a14f8a8b
1 changed files with 6 additions and 6 deletions

View File

@ -19,20 +19,20 @@ const DifferentParent = Parent;
// #enddocregion provide-the-parent
// The `parentType` defaults to `Parent` when omitting the second parameter.
// #docregion provide-the-parent
const provideParent =
export function provideParent
// #enddocregion provide-parent, provide-the-parent
// #docregion provide-parent
(component: any, parentType?: any) => {
(component: any, parentType?: any) {
return { provide: parentType || Parent, useExisting: forwardRef(() => component) };
};
}
// #enddocregion provide-parent
// Simpler syntax version that always provides the component in the name of `Parent`.
const provideTheParent =
export function provideTheParent
// #docregion provide-the-parent
(component: any) => {
(component: any) {
return { provide: Parent, useExisting: forwardRef(() => component) };
};
}
// #enddocregion provide-the-parent