<div class="backdrop" #modal *ngIf="show" (click)="close()">
    <div class="contents" role="dialog" id="{{ id }}"
        (click)="$event.stopPropagation()"
        [attr.aria-labelledby]="title ? titleId : null"
        [attr.aria-describedby]="contentId">
        <h2 class="title" id="{{ titleId }}" *ngIf="title">{{ title }}</h2>
        <div id="{{ contentId }}">
            <ng-content></ng-content>
        </div>
        <footer>
            <button class="closeBtn" (click)="close()">Close</button>
        </footer>
    </div>
</div>

<div class="backdrop" *ngIf="show" (click)="close()">
    <div class="contents" role="dialog" id="{{ id }}"
        #modal
        (click)="$event.stopPropagation()"
        [attr.aria-labelledby]="title ? titleId : null"
        [attr.aria-describedby]="contentId">
        <h2 class="title" id="{{ titleId }}" *ngIf="title">{{ title }}</h2>
        <div id="{{ contentId }}">
            <ng-content></ng-content>
        </div>
        <footer>
            <button class="closeBtn" (click)="close()">Close</button>
        </footer>
    </div>
</div>

Move modal ref to content element 🤖
Move modal ref to content element 🤖
