From 44e1b23813961fa29b9569b772af36a9410a2cba Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 12 Aug 2016 14:46:45 -0700 Subject: [PATCH] refactor(PlatformRef): remove deprecated PlatformRef#registerDisposeListener, #disposed, #dispose() BREAKING CHANGE: previously deprecated PlatformRef#registerDisposeListener, #disposed, #dispose() - follow deprecation instructions to upgrade --- modules/@angular/core/src/application_ref.ts | 20 ++------------------ tools/public_api_guard/core/index.d.ts | 3 --- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/modules/@angular/core/src/application_ref.ts b/modules/@angular/core/src/application_ref.ts index ab8407c2dc..af637e81d7 100644 --- a/modules/@angular/core/src/application_ref.ts +++ b/modules/@angular/core/src/application_ref.ts @@ -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(); } } diff --git a/tools/public_api_guard/core/index.d.ts b/tools/public_api_guard/core/index.d.ts index 79deeab892..e81fd39f52 100644 --- a/tools/public_api_guard/core/index.d.ts +++ b/tools/public_api_guard/core/index.d.ts @@ -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(moduleType: Type, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise>; /** @experimental */ bootstrapModuleFactory(moduleFactory: NgModuleFactory): Promise>; abstract destroy(): void; - /** @deprecated */ abstract dispose(): void; abstract onDestroy(callback: () => void): void; - /** @deprecated */ abstract registerDisposeListener(dispose: () => void): void; } /** @deprecated */