title: Pass string value in providers and pass value to super of Base Service
body: <p>I am creating a generic crud service that i want to use throughout my angular application in various feature modules.</p>
  
  <p>To achieve this i need to pass a string value to a service in providers: of an angular module, so i can then set a value to the super of the base service.  Is this possible?</p>
  
  <p><strong>Config</strong></p>
  
  <pre><code>import { InjectionToken } from '@angular/core';
  
  export const COLLECTION_REF = new InjectionToken&lt;string&gt;('collection');
  </code></pre>
  
  <p><strong>Module</strong></p>
  
  <pre><code> import { GenericEntityService } from '@mifowi/core/services/genericEntity.service';
  import { COLLECTION_REF } from './orgModuleConfig';
      import { NgModule } from '@angular/core';
      import { RouterModule } from '@angular/router';
  
  
  @NgModule({
      ....
      **I want to pass in a string value of 'Organization' to the GenericEntityService**
      providers: [
      GenericEntityService,
      { provide: COLLECTION_REF, useValue: 'Organization' }
  ],
  })
  export class OrganizationsModule {}
  </code></pre>
  
  <p><strong>Generic Service</strong></p>
  
  <pre><code> import { FirestoreService } from './firestore.service';
      import { Injectable } from '@angular/core';
      import {
          EntityCollectionServiceBase,
          EntityCollectionServiceElementsFactory
      } from '@ngrx/data';
      import { Observable } from 'rxjs';
  
  
  
  
       @Injectable()
          export class GenericEntityService extends EntityCollectionServiceBase&lt;any&gt; {
              constructor(
      @Inject(COLLECTION_REF) private collection: string,
                  public firestoreService: FirestoreService,
                  elementsFactory: EntityCollectionServiceElementsFactory
              ) {
                  **I want to set the string below to
  
   the value passed in providers in the module - see above**
              super(collection, elementsFactory);
          }
  
          getMyEntityList(entity: string, id: string): Observable&lt;any[]&gt; {
              return this.firestoreService.getMyEntityList(entity, id);
          }
  
          getEntityByName(entity: string, str: string): Observable&lt;any[]&gt; {
              return this.firestoreService.colWithName$(entity, str);
          }
  
          createNewEntity(entity: string, payload: any): void {
              this.firestoreService.createDoc(entity, payload);
          }
  
          updateEntity(entity: string, payload: any): void {
              this.firestoreService.updateDoc(entity, payload);
          }
  
          deleteEntity(entity: string, payload: any): void {
              this.firestoreService.deleteDoc(entity, payload);
          }
      }
  </code></pre>