title: Why Matdialog is not closing in dev environment?
body: <p>I am implementing a material dialog which should be opened once the page loads.</p>
  <p>The component that is displayed is brought from a angular library (not the same project).</p>
  <p>To close the dialog an @Output event is emitted from the library to the project to close the modal.</p>
  <p>On localhost is working perfectly but when i build and display to the environment, the dialog never closes</p>
  <p>Project Component:</p>
  <pre><code>constructor(){
      let DialogRefChangePw = this.dialog.open(ɵcn , {
        panelClass: 'onboardingModalChange'
      });
  
      DialogRefChangePw.componentInstance.CloseOnboardingModalEvent.subscribe((res: any) =&gt; {
        DialogRefChangePw.close();
      });
  }
  </code></pre>
  <p>Library component:</p>
  <pre><code>@Component({
    selector: 'lib-password-change-modal',
    templateUrl: './password-change-modal.component.html',
    styleUrls: ['./password-change-modal.component.scss']
  })
  export class PasswordChangeModalComponent implements OnInit {
    @Output() CloseOnboardingModalEvent = new EventEmitter&lt;boolean&gt;();
    constructor(
    ) {}
  
    ngOnInit(): void {
    }
  
    closeModal(){
      this.CloseOnboardingModalEvent.emit(true);
    }
  }
  </code></pre>
  <p>There is a close icon in <code>password-change-modal.component.html</code> that triggers the <code>closeModal()</code> method.</p>
  <p>I am using Angular 12 and compiling with Ivy. Thanks in advance.</p>