title: NullInjectorError: No provider for MatDialog! error showing while using guard with mat dialog
body: <p>I have an error:</p>
  
  <pre><code>VM654 vendor.js:29876 ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(AccountsModule)[CreateAccountGuard -&gt; CreateAccountGuard -&gt; CreateAccountGuard -&gt; ModalService -&gt; MatDialog -&gt; MatDialog -&gt; MatDialog]:   NullInjectorError: No provider for MatDialog!
  </code></pre>
  
  <p>I do not get what is wrong and why I see it.</p>
  
  <p>Basically, in CreateAccountGuard (which is in Accounts Module) I use Modal service to open confirmation modal. </p>
  
  <p>Confirmation modal component and ModalService  are in another module - Modals module.
  I have added Confirmation modal component to declarations and entryComponents. MatDialogModule is also added there in imports. </p>
  
  <p>While running Jasmine test - no issues. But on the website -  I see this error. </p>
  
  <p>Unfortunately, cannot share the code. Maybe you have any ideas what to do from here?</p>