【发布时间】:2017-10-09 22:27:53
【问题描述】:
我有一个 Angular 2 项目设置,其中有一个名为 'app component' 的父组件,在 ap 组件中有 2 个名为 'child1 component' 和 'child2 component' 的子组件。
我的项目结构如下:
app.component
-- child1 component
-- child2 component
现在我的问题是:“child1 组件”中有一个按钮,“child2 组件”中有一个变量“variableOfChild2Component”。现在,当我单击“child1 组件”的那个按钮时,child2 组件的变量值应该会改变。如何在角度 2 中实现此要求?
【问题讨论】:
标签: angular2-routing angular2-template angular2-directives