【发布时间】:2022-07-26 21:51:14
【问题描述】:
组件:OpenMultiTimeComponent
选择器:'open-multi-time'
需要以下情况的解决方案,
- 打开对话框 - 加载 OpenMultiTimeComponent 组件。
- 打开另一个对话框 - 加载 TestComponent 组件。
- 在 TestComponent 中打开 OpenMultiTimeComponent。
<mat-dialog> // Dialog 1
<open-multi-time></open-multi-time> // Ref: 1
<TestComponent> // Dialog 2
<mat-dialog>
<open-multi-time></open-multi-time> // Ref: 2
</mat-dialog>
</TestComponent>
</mat-dialog>
问题:
- 当我从 Ref: 2 组件更新任何变量时,它会从 Ref: 1 更新相同的变量。这是一个问题。
我们不想从 Ref:1 组件更新该变量。我们需要 Ref:1 和 Ref:2 的独特组件。
【问题讨论】:
标签: angular angular-material angular10