From f57b7df4d7d3054f9e81ad9dd0a0a5844a02adb6 Mon Sep 17 00:00:00 2001 From: Chuck Jazdzewski Date: Tue, 26 Sep 2017 10:18:10 -0700 Subject: [PATCH] fix(compiler): remove deprecated `Compiler.ngGetContentSelectors()` (#19347) BREAKING CHANGE: The method `ngGetConentSelectors()`, deprecated in Angular 4.0, has been removed. Use `ComponentFactory.ngContentSelectors` instead. --- packages/compiler/src/jit/compiler.ts | 10 ---------- packages/core/src/linker/compiler.ts | 10 ---------- .../platform-browser-dynamic/src/compiler_factory.ts | 3 --- .../testing/src/compiler_factory.ts | 4 ---- tools/public_api_guard/core/core.d.ts | 1 - 5 files changed, 28 deletions(-) diff --git a/packages/compiler/src/jit/compiler.ts b/packages/compiler/src/jit/compiler.ts index 0bfac0db6b..409b3a49b1 100644 --- a/packages/compiler/src/jit/compiler.ts +++ b/packages/compiler/src/jit/compiler.ts @@ -67,16 +67,6 @@ export class JitCompiler { return Promise.resolve(this._compileModuleAndAllComponents(moduleType, false)); } - getNgContentSelectors(component: Type): string[] { - this._console.warn( - 'Compiler.getNgContentSelectors is deprecated. Use ComponentFactory.ngContentSelectors instead!'); - const template = this._compiledTemplateCache.get(component); - if (!template) { - throw new Error(`The component ${stringify(component)} is not yet compiled!`); - } - return template.compMeta.template !.ngContentSelectors; - } - getComponentFactory(component: Type): object { const summary = this._metadataResolver.getDirectiveSummary(component); return summary.componentFactory as object; diff --git a/packages/core/src/linker/compiler.ts b/packages/core/src/linker/compiler.ts index 5149882e5d..f75031c63d 100644 --- a/packages/core/src/linker/compiler.ts +++ b/packages/core/src/linker/compiler.ts @@ -69,16 +69,6 @@ export class Compiler { throw _throwError(); } - /** - * Exposes the CSS-style selectors that have been used in `ngContent` directives within - * the template of the given component. - * This is used by the `upgrade` library to compile the appropriate transclude content - * in the AngularJS wrapper component. - * - * @deprecated since v4. Use ComponentFactory.ngContentSelectors instead. - */ - getNgContentSelectors(component: Type): string[] { throw _throwError(); } - /** * Clears all caches. */ diff --git a/packages/platform-browser-dynamic/src/compiler_factory.ts b/packages/platform-browser-dynamic/src/compiler_factory.ts index 8d86ff915b..f19467a765 100644 --- a/packages/platform-browser-dynamic/src/compiler_factory.ts +++ b/packages/platform-browser-dynamic/src/compiler_factory.ts @@ -71,9 +71,6 @@ export class CompilerImpl implements Compiler { componentFactories: result.componentFactories as ComponentFactory[], })); } - getNgContentSelectors(component: Type): string[] { - return this._delegate.getNgContentSelectors(component); - } loadAotSummaries(summaries: () => any[]) { this._delegate.loadAotSummaries(summaries); } hasAotSummary(ref: Type): boolean { return this._delegate.hasAotSummary(ref); } getComponentFactory(component: Type): ComponentFactory { diff --git a/packages/platform-browser-dynamic/testing/src/compiler_factory.ts b/packages/platform-browser-dynamic/testing/src/compiler_factory.ts index eaae83a22e..b2dda8b0f9 100644 --- a/packages/platform-browser-dynamic/testing/src/compiler_factory.ts +++ b/packages/platform-browser-dynamic/testing/src/compiler_factory.ts @@ -57,10 +57,6 @@ export class TestingCompilerImpl implements TestingCompiler { return this._compiler.compileModuleAndAllComponentsAsync(moduleType); } - getNgContentSelectors(component: Type): string[] { - return this._compiler.getNgContentSelectors(component); - } - getComponentFactory(component: Type): ComponentFactory { return this._compiler.getComponentFactory(component); } diff --git a/tools/public_api_guard/core/core.d.ts b/tools/public_api_guard/core/core.d.ts index 28dfeb1ce9..51fe21bb95 100644 --- a/tools/public_api_guard/core/core.d.ts +++ b/tools/public_api_guard/core/core.d.ts @@ -182,7 +182,6 @@ export declare class Compiler { compileModuleAndAllComponentsSync(moduleType: Type): ModuleWithComponentFactories; compileModuleAsync(moduleType: Type): Promise>; compileModuleSync(moduleType: Type): NgModuleFactory; - /** @deprecated */ getNgContentSelectors(component: Type): string[]; } /** @experimental */