In Angular 2, you can specify a @CanActivate annotation for a component where you can determine if the component should be activated or not. The reason it\'s no
Here (https://gist.github.com/clemcke/c5902028a1b0934b03d9) is how to test the addInjector() solution that @shannon references:
beforeEachProviders(()=>[PERSON_SERVICE_PROVIDERS]);
beforeEach(inject([PersonService],()=>{
let injector = Injector.resolveAndCreate([PERSON_SERVICE_PROVIDERS]);
appInjector(injector);
}));