title: Cannot instantiate cyclic dependency! ApplicationRef ("[ERROR ->]"): in NgModule AppModule in ./AppModule@-1:-1
body: <blockquote>
    <p>I have added this code into my app.module.ts</p>
  </blockquote>
  
  <pre><code>    providers: [ AppConfigService,
              {
                  provide: APP_INITIALIZER,
                  useFactory: (config: AppConfigService) =&gt; () =&gt; config.getAppConfig(),
                  deps: [AppConfigService],
                  multi: true
              },
  ]
  </code></pre>
  
  <p><strong>Getting this error</strong></p>
  
  <p><a href="https://i.stack.imgur.com/HwhQm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HwhQm.png" alt="enter image description here"></a></p>
  
  <p><strong>Issue</strong>: i have used <a href="https://www.npmjs.com/package/ngx-permissions" rel="noreferrer">ngx-permission</a> pkg for permission. i set <a href="https://www.npmjs.com/package/ngx-permissions#usage-with-routes" rel="noreferrer">route</a> permission method. but when i refresh a page that time redirect on home page instead stay on current page. so i tried <a href="https://www.npmjs.com/package/ngx-permissions#to-load-permissions-before-application-start-up" rel="noreferrer">to load permissions before application start up method</a> for resolve this issue but got this error.</p>
  
  <pre><code> config.getAppConfig() // call when application start up
  </code></pre>
  
  <p>have any idea please help. other solution also welcome.  </p>