refactor(PlatformRef): remove deprecated PlatformRef#registerDisposeListener, #disposed, #dispose()

BREAKING CHANGE: previously deprecated PlatformRef#registerDisposeListener, #disposed, #dispose() - follow deprecation instructions to upgrade
This commit is contained in:
Igor Minar 2016-08-12 14:46:45 -07:00 committed by Vikram Subramanian
parent 12b0a3d0e5
commit 44e1b23813
2 changed files with 2 additions and 21 deletions

View File

@ -66,7 +66,7 @@ export function isDevMode(): boolean {
* @experimental APIs related to application bootstrap are currently under review.
*/
export function createPlatform(injector: Injector): PlatformRef {
if (isPresent(_platform) && !_platform.disposed) {
if (isPresent(_platform) && !_platform.destroyed) {
throw new BaseException(
'There can be only one platform. Destroy the previous one to create a new one.');
}
@ -140,7 +140,7 @@ export function destroyPlatform(): void {
* @experimental APIs related to application bootstrap are currently under review.
*/
export function getPlatform(): PlatformRef {
return isPresent(_platform) && !_platform.disposed ? _platform : null;
return isPresent(_platform) && !_platform.destroyed ? _platform : null;
}
/**
@ -224,12 +224,6 @@ export abstract class PlatformRef {
throw unimplemented();
}
/**
* Register a listener to be called when the platform is disposed.
* @deprecated Use `OnDestroy` instead
*/
abstract registerDisposeListener(dispose: () => void): void;
/**
* Register a listener to be called when the platform is disposed.
*/
@ -241,21 +235,11 @@ export abstract class PlatformRef {
*/
get injector(): Injector { throw unimplemented(); };
/**
* Destroy the Angular platform and all Angular applications on the page.
* @deprecated Use `destroy` instead
*/
abstract dispose(): void;
/**
* Destroy the Angular platform and all Angular applications on the page.
*/
abstract destroy(): void;
/**
* @deprecated Use `destroyed` instead
*/
get disposed(): boolean { throw unimplemented(); }
get destroyed(): boolean { throw unimplemented(); }
}

View File

@ -995,14 +995,11 @@ export declare const platformCore: (extraProviders?: any[]) => PlatformRef;
/** @experimental */
export declare abstract class PlatformRef {
destroyed: boolean;
/** @deprecated */ disposed: boolean;
injector: Injector;
/** @stable */ bootstrapModule<M>(moduleType: Type<M>, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise<NgModuleRef<M>>;
/** @experimental */ bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>): Promise<NgModuleRef<M>>;
abstract destroy(): void;
/** @deprecated */ abstract dispose(): void;
abstract onDestroy(callback: () => void): void;
/** @deprecated */ abstract registerDisposeListener(dispose: () => void): void;
}
/** @deprecated */