title: Send parameter from component to service constructor in angular 6
body: <p>I'm new in angular6, when I send a parameter from component to service, I get StaticInjectorError. What is wrong?</p>
  
  <p>My code is something like this
  component: </p>
  
  <pre><code>import { Component, Input, OnInit } from '@angular/core';
  import { myService } from '../../@core/data/myService';
  @Component({
    selector: 'table',
    templateUrl: './table.component.html'
  })
  export class TableComponent implements OnInit {
    constructor(private service: myService) {
    }
    ngOnInit() {
      this.service = new myService ("name");
  }
  </code></pre>
  
  <p>service:</p>
  
  <pre><code> import { Injectable, Inject } from '@angular/core';
      import { Observable } from 'rxjs/Observable';
      import { DataService } from './data.service';
  
      @Injectable() export class myService {
  
          constructor(
              entityName: string,
          ) {
              console.log(entityName);
          }
      }
  </code></pre>
  
  <p>app.module.ts:</p>
  
  <pre><code>import { myService } from './@core/data/myService '
  import { TableModule } from './pages/table/table.module';
  
  @NgModule({
    declarations: [AppComponent],
    imports: [
      BrowserModule,
      BrowserAnimationsModule,
      HttpClientModule,
      AppRoutingModule,
  
      NgbModule.forRoot(),
      ThemeModule.forRoot(),
      CoreModule.forRoot(),
    ],
    bootstrap: [AppComponent],
    providers: [
      myService,
      TableModule
    ],
  })
  export class AppModule {
  }
  </code></pre>
  
  <p>error message:
  ProductsComponent.html:1 ERROR Error: StaticInjectorError(AppModule)[BDBaseService -> String]: 
    StaticInjectorError(Platform: core)[BDBaseService -> String]: 
      NullInjectorError: No provider for String!
      at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (core.js:979)
      at resolveToken (core.js:1232)
      at tryResolveToken (core.js:1182)
      at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:1077)
      at resolveToken (core.js:1232)
      at tryResolveToken (core.js:1182)
      at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:1077)
      at resolveNgModuleDep (core.js:9238)
      at _createClass (core.js:9283)
      at _createProviderInstance$1 (core.js:9255)</p>