angular 7 how to access element by id defined in parent component from child component template

Refresh

April 2019

Views

2 time

0

I am using primeng multiSelect control in the child component. i want this to be appended to the element defined in the parent component as shown above. the above code failed when i run npm run build:prod. it can't access popupContent in the child. can anyone help how to access the parent element in the child component?

**Parent component:**

                <tbody app-sg-add-edit-subline-agg (sublineSave)="onSublineSave($event)" #popupContent>   
                </tbody>

**sg-add-edit-subline-agg component:**
                <p-multiSelect optionLabel="name"
                   [options]="sublines"
                   formControlName="name"
                   [appendTo]="popupContent">   

Thanks

0 answers