title: Cannot inject InjectionToken to service constructor
body: <p>i need to resolve, why my injectionToken is not being injected in class constructor. I have angular (7.1), code generated from NSwag.</p>
  
  <p>I have already tried putting providers code in both module and component. Thanks for advice.</p>
  
  <p>client.ts</p>
  
  <pre><code>export const API_BASE_URL = new InjectionToken&lt;string&gt;('API_BASE_URL');
  
  export class Client implements IClient {
  private http: HttpClient;
  private baseUrl: string;
  protected jsonParseReviver: ((key: string, value: any) =&gt; any) | undefined = undefined;
  // Removed @Optional for debug purpose
  constructor(@Inject(HttpClient) http: HttpClient, @Inject(API_BASE_URL) baseUrl?: string) {
      this.http = http;
      this.baseUrl = baseUrl ? baseUrl : "";
  }
  }
  </code></pre>
  
  <p>app.module.ts</p>
  
  <pre><code>const API_BASE_URL = new InjectionToken&lt;string&gt;('API_BASE_URL');
  
  // providers array
  providers: [
      {provide: API_BASE_URL, useValue: 'localhost:1234'},
      Client,
      ArticleService
  ]
  </code></pre>
  
  <p>article.service.ts</p>
  
  <pre><code>@Injectable({
    providedIn: 'root'
  })
  export class ArticleService {
  
    client: Client;
  
    constructor(client: Client) {
      this.client = client;
    }
  }
  
  
  ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppModule) 
  [Client -&gt; InjectionToken API_BASE_URL]: 
    StaticInjectorError(Platform: core)[Client -&gt; InjectionToken API_BASE_URL]: 
     NullInjectorError: No provider for InjectionToken API_BASE_URL!
  Error: StaticInjectorError(AppModule)[Client -&gt; InjectionToken API_BASE_URL]: 
    StaticInjectorError(Platform: core)[Client -&gt; InjectionToken API_BASE_URL]: 
      NullInjectorError: No provider for InjectionToken API_BASE_URL!
  </code></pre>