How do I create a singleton service in Angular 2?
问题 I've read that injecting when bootstrapping should have all children share the same instance, but my main and header components (main app includes header component and router-outlet) are each getting a separate instance of my services. I have a FacebookService which I use to make calls to the facebook javascript api and a UserService that uses the FacebookService. Here's my bootstrap: bootstrap(MainAppComponent, [ROUTER_PROVIDERS, UserService, FacebookService]); From my logging it looks like