Angular / Angular Fundamentals #7: Services

In this video Mosh described Dependency injection where, if you create a service and then create an instance of the service in a Component using the new keyword, this is not desired because, in the future, if the Service is changed to require a parameter, you would have to change the new line to include that parameter. Instead, he recommended Dependency Injection. However, he did not describe how to deal with the service needing parameters when including the service in the Component’s constructor, i.e.:

constructor(service: CoursesService)

How do you set the required parameter of a service?

like this? constructor(service: CoursesService(1)) ?

or in the app.module.ts file?

providers: [ CoursesService(1) ]

neither seem appropriate.