title: Angular5 - How to check if a module is loaded
body: <p>in Angular 5 I need to know if the module has already been loaded in order not to show the spinner.
  At the moment my code is this:</p>
  
  <pre><code>    constructor(private loaderService: LoaderService, private router: Router, @Inject(DOCUMENT) private document: Document) {
      this.router.events.subscribe(event =&gt; {
          console.log(this.router);
          if (event instanceof NavigationStart) {
              this.isSpinnerVisible = true;
          } else if (event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError) {
              this.isSpinnerVisible = false;
          }
      }, () =&gt; {
          this.isSpinnerVisible = false;
      });
  }
  </code></pre>
  
  <p>In this way, if the module has already been loaded, I still show the module for a tenth of a second.
  Some idea?</p>