From 7b606a80aaf695d077b41da8df8392d06314a7b0 Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Tue, 25 May 2021 14:34:28 -0700 Subject: [PATCH] docs: clarify the shortcomings of local variable technique for parent-child component interactions (#42331) Closes #38302 PR Close #42331 --- aio/content/guide/component-interaction.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aio/content/guide/component-interaction.md b/aio/content/guide/component-interaction.md index 68fdbc52a3c5e..8d079cab31386 100644 --- a/aio/content/guide/component-interaction.md +++ b/aio/content/guide/component-interaction.md @@ -300,8 +300,11 @@ The *local variable* approach is easy. But it is limited because the parent-child wiring must be done entirely within the parent template. The parent component *itself* has no access to the child. -You can't use the *local variable* technique if an instance of the parent component *class* -must read or write child component values or must call child component methods. +You can't use the *local variable* technique if the parent component's *class* relies on the +child component's *class*. The parent-child relationship of the components is not established +within each components respective *class* with the *local variable* technique. Since the *class* +instances are not connected to one another, the parent *class* cannot access the child *class* +properties and methods. When the parent component *class* requires that kind of access, ***inject*** the child component into the parent as a *ViewChild*.