Thanks Indrajeet, It is working for the dialogue which is in the same component but here is my
another case, in which the dialogue is in different component and it is called in another component by the selector of the component which contains it. in that case it is not working.
basic component :
<div *ngIf="showstepcol">
<app-step-columns></app-step-columns>
</div>
showstepcol this boolean variable is set to true and false inside this component only
calling component which contains the dialogue
<ejs-dialog class="demo" #confirmationDialog [animationSettings]='animationSettings'
showCloseIcon="true" isModal="true" allowDragging='true'>
<ng-template #header>
some header content
</ng-template>
<ng-template #content>
</ng-template>
</ejs-dialog>
Please help