title: How to make parameters of a forRoot Method to be Optional?
body: <p>I am providing a config required for my service in my lib via <code>forRoot</code>.
  I want this library to be used with default config, if consuming app doesn't want. I tried using <code>@Optional</code>, but doesn't work. </p>
  
  <p>Here is my sample module</p>
  
  <pre><code>@NgModule({
      imports: [CommonModule, HttpClientModule, FormsModule, ReactiveFormsModule, RouterModule],
      declarations: [MyComponent],
      exports: [MyComponent]
  })
  export class MyModule {
    // Configure url, clientid &amp; other for widget specific configuration
    public static forRoot(@Optional() options: Config): ModuleWithProviders {
      if (!options) {
        options = { url: 'default-url', otherparams: []};
      }
      return { ngModule: MyModule, providers: [MyService, {provide: Config, useValue: options} ]};
    }
  </code></pre>
  
  <p>This code doesn't work when I use it like this in consuming app</p>
  
  <pre><code>MyModule.forRoot()
  </code></pre>
  
  <p>It gives me error: </p>
  
  <blockquote>
    <p>arguments 0 instead of 1.</p>
  </blockquote>
  
  <p>Is it even possible to make params optional? If yes, How? </p>
  
  <p>Is there a better way to accept config from consuming app (except input for components)?</p>