title: How to determine where the component is called from? angular
body: <p>I have a component that I want to use as a modal</p>
  <pre><code>     showMyPopup(): void {
      this.matDialog.open(MyComponent, {
        maxWidth: '92vw',
        maxHeight: '90vh',
        width: '100%',
        height: '100%',
        position: {
          right: '10px',
          bottom: '6px',
        },
        data: {
          isModalComponent: true,
        },
      });
    }
  }
  </code></pre>
  <p>and just a page</p>
  <pre><code>     &lt;app-my-component&gt;
  
    &lt;/app-my-component&gt;
  </code></pre>
  <p>how can I determine that this is a modal window? to change its styles inside the component?
  i tried like this</p>
  <pre><code> constructor(@Inject(MAT_DIALOG_DATA) data) {
  console.log(data);
  </code></pre>
  <p>}
  but this does not work, because an error falls if the window is not modal</p>