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-13 17:05:17 -07:00
|
|
|
import {ComponentRef} from 'angular2/src/core/linker/component_factory';
|
2015-10-26 10:50:25 -07:00
|
|
|
import {Provider, Injector} from 'angular2/src/core/di';
|
|
|
|
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-12 09:40:37 -07:00
|
|
|
bootstrap(componentType: Type, bindings?: Array<Type | Provider | any[]>): Promise<ComponentRef> {
|
2015-10-26 10:50:25 -07:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
get injector(): Injector { return null; };
|
|
|
|
|
|
|
|
get zone(): NgZone { return null; };
|
|
|
|
|
|
|
|
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
|
|
|
}
|