title: Angular 2: how to force an injectable to be a singleton in the app
body: <p>I have an <code>@Injectable</code> service in my application that is added as a provider in <code>AppModule</code>. I want to make sure no one in my development team injects it in any other module. A single instance is enough and it has some complicated logic that I don't want to be run twice. Any ideas?</p>
  
  <p>I know how DI works in angular 2, so answers like 'Make sure it is added as a provider only in App Module' won't help. :(</p>
  
  <p>PLEASE NOTE, that I want it to produce some sort of error at build or run time if the service is provided to any other but AppModule.</p>