Check out example codes for "injection of generic services in angular". It will help you in understanding the concepts better.

Code Example 1

@NgModule({
  imports: [CommonModule],
  declarations: [Component3Component],
  exports: [Component3Component],
  providers: [ApiService, { provide: MY_API_ENDPOINT, useValue: "api.end.point.3" }]
})
export class App2Module { }

Learn ReactJs, React Native from akashmittal.com