我有一个步进组件。在 stepper-component.html 中,我有四个组件作为 mat-steps,如下所示 -
<div class="container-fluid">
<mat-horizontal-stepper linear #stepper>
<mat-step label="Step1">
<component-1></component-1>
</mat-step>
<mat-step label="Step2">
<component-2></component-2>
</mat-step>
<mat-step label="Step3">
<component-3></component-3>
</mat-step>
<mat-step label="Step4">
<component-4></component-4>
</mat-step>
</mat-horizontal-stepper>
</div>
我想通过单击不同组件中的按钮来访问组件2,比如组件 X,并在组件 2 中执行一些功能。我怎样才能做到这一点?