When a service is declared at root module and injected in two components, a separate instance will be created for each of the components. code example
Example 1: how to inject service in component angular 6
you can inject service in components constructor:
constructor(public anyService: Service){}
Example 2: angular import service
import { Service } from '../';