我需要在子组件中绑定根组件,当单击适当的链接时,会出现一个弹出窗口并显示根组件数据
在activity.html页面中添加并调用相关函数 但数据没有加载
<section id="ProjectContent" *ngIf="isShowPlan">
<!--<project-app [sectionType]="FLOWCHART" [pageType]="projectPageType"
[section]="projectSection" [projectId]="newprojectId"
[clientId]="newclientId" [projectName]="projectName">
Loading...</project-app>-->
<project-app section_type="LINK" page_type="projectPageType"section="projectSection"
project_id="newprojectId"client_id="newclientId" is_expand="true">
Loading...</project-app>
<!--<project-app sectionType="LINK" pageType="projectPageType"
section="projectSection" projectId="newprojectId" clientId="newclientId"
projectName="projectName">
Loading...</project-app>-->
</section>
答案 0 :(得分:0)
通过DI
机制,您可以将任何父组件注入子
<强> Child.component.ts 强>:
...
constuctor(public parent: SomeParentComponent){
}