title: angular 5 Error: Can't resolve all parameters for Service
body: <p>I could use a little help.</p>
  
  <p>Context I am making a angular 5 module for an authentication service.</p>
  
  <p>How do I pass a POJO into a class as parameters?</p>
  
  <p>See my answer below.</p>
  
  <p><strike>
  I need to use HttpClient inside this auth service</p>
  
  <p>I am getting this error:</p>
  
  <blockquote>
    <p>Error: Can't resolve all parameters for AuthService: ([object Object], ?).</p>
  </blockquote>
  
  <p>[object Object] is angular 5 HttpClient
  </strike></p>
  
  <p>Can some one please explain why I am getting this error and how to resolve it?</p>
  
  <pre><code>@NgModule()
  
  export class AuthtModule {
    static forRoot(params?: iParams) {
      return {
          ngModule: AuthModule,
          provides: [
              HttpClient,
              {
                  provide: AuthService,
                  useFactory: setupAuthService,
                  deps: [ HttpClient, params ]
              }
          ],
          imports: [ HttpClientModule ],
          exports: [ AuthService ]            
  
      }
    }
  }
  </code></pre>
  
  <p>Thanks in advance.
  Cheers</p>