angular-docs-cn/modules/angular2/src/mock/mock_application_ref.ts
vsavkin 79472b77ca refactor(core): move facades out of core
This is part of ongoing work to make core platform-independent.

BREAKING CHANGE

All private exports from 'angular2/src/core/facade/{lang,collection,exception_handler}' should be replaced with 'angular2/src/facade/{lang,collection,exception_handler}'.
2015-11-07 01:36:06 +00:00

26 lines
848 B
TypeScript

import {ApplicationRef} from 'angular2/src/core/application_ref';
import {Type} from 'angular2/src/facade/lang';
import {ComponentRef} from 'angular2/src/core/linker/dynamic_component_loader';
import {Provider, Injector} from 'angular2/src/core/di';
import {NgZone} from 'angular2/src/core/zone/ng_zone';
import {Promise} from 'angular2/src/facade/async';
export class MockApplicationRef extends ApplicationRef {
registerBootstrapListener(listener: (ref: ComponentRef) => void): void {}
registerDisposeListener(dispose: () => void): void {}
bootstrap(componentType: Type, bindings?: Array<Type | Provider | any[]>): Promise<ComponentRef> {
return null;
}
get injector(): Injector { return null; };
get zone(): NgZone { return null; };
dispose(): void {}
tick(): void {}
get componentTypes(): Type[] { return null; };
}