Angular 8-如何访问父级ng模板中使用的子级组件的变量

时间:2020-01-17 13:22:27

标签: javascript angular angular-material angular-cdk ng-template

在父组件的模板中,我正在ng-template中使用子组件,像这样

<ng-template #signalsDialog>
        <div class="dialog">
            <child-selector
                [Id]="parentModel.id"
                [listSource]="parentModel.signals"
                [loadingState]="parentModel.loadingState"
                (closeDropDown)="closeDropdown()">
            </child-selector>
        </div>
    </ng-template>

此#signalsDialog在父组件中显示为CDK Overlay组件,如下所示 enter image description here

问题#1 当搜索成功并且列表在后台更新时,除非我关闭并重新打开它,否则它不会在覆盖组件中更新。

问题#2 如果我想访问子组件的某些变量(例如搜索的等待状态),而该子组件显示为覆盖层,则无法访问。

请帮助我,无论是重叠限制还是与 ng-tempalte 相关的内容。

0 个答案:

没有答案
相关问题