2015-10-26 10:50:25 -07:00
|
|
|
import {ApplicationRef} from 'angular2/src/core/application_ref';
|
2015-12-03 09:06:42 -08:00
|
|
|
import {Injectable} from 'angular2/src/core/di';
|
2015-11-06 17:34:07 -08:00
|
|
|
import {Type} from 'angular2/src/facade/lang';
|
2016-04-14 14:52:35 -07:00
|
|
|
import {ComponentRef, ComponentFactory} from 'angular2/src/core/linker/component_factory';
|
|
|
|
import {Injector} from 'angular2/src/core/di';
|
2015-10-26 10:50:25 -07:00
|
|
|
import {NgZone} from 'angular2/src/core/zone/ng_zone';
|
|
|
|
|
2015-12-03 15:49:09 -08:00
|
|
|
/**
|
|
|
|
* A no-op implementation of {@link ApplicationRef}, useful for testing.
|
|
|
|
*/
|
2015-12-03 09:06:42 -08:00
|
|
|
@Injectable()
|
2015-10-26 10:50:25 -07:00
|
|
|
export class MockApplicationRef extends ApplicationRef {
|
|
|
|
registerBootstrapListener(listener: (ref: ComponentRef) => void): void {}
|
|
|
|
|
|
|
|
registerDisposeListener(dispose: () => void): void {}
|
|
|
|
|
2016-04-14 14:52:35 -07:00
|
|
|
bootstrap(componentFactory: ComponentFactory): ComponentRef { return null; }
|
2015-10-26 10:50:25 -07:00
|
|
|
|
|
|
|
get injector(): Injector { return null; };
|
|
|
|
|
|
|
|
get zone(): NgZone { return null; };
|
|
|
|
|
2016-04-14 14:52:35 -07:00
|
|
|
run(callback: Function): any { return null; }
|
|
|
|
|
|
|
|
waitForAsyncInitializers(): Promise<any> { return null; }
|
|
|
|
|
2015-10-26 10:50:25 -07:00
|
|
|
dispose(): void {}
|
|
|
|
|
2015-10-28 10:34:13 -07:00
|
|
|
tick(): void {}
|
|
|
|
|
2015-10-26 10:50:25 -07:00
|
|
|
get componentTypes(): Type[] { return null; };
|
2015-12-03 09:06:42 -08:00
|
|
|
}
|