how to inject service in component angular 6

JavaScript
you can inject service in components constructor:
constructor(public anyService: Service){}
Source

Also in JavaScript: