fix(compiler): remove deprecated `Compiler.ngGetContentSelectors()` (#19347)
BREAKING CHANGE: The method `ngGetConentSelectors()`, deprecated in Angular 4.0, has been removed. Use `ComponentFactory.ngContentSelectors` instead.
This commit is contained in:
parent
2cf52c1b55
commit
f57b7df4d7
|
@ -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;
|
||||
|
|
|
@ -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<any>): string[] { throw _throwError(); }
|
||||
|
||||
/**
|
||||
* Clears all caches.
|
||||
*/
|
||||
|
|
|
@ -71,9 +71,6 @@ export class CompilerImpl implements Compiler {
|
|||
componentFactories: result.componentFactories as ComponentFactory<any>[],
|
||||
}));
|
||||
}
|
||||
getNgContentSelectors(component: Type<any>): string[] {
|
||||
return this._delegate.getNgContentSelectors(component);
|
||||
}
|
||||
loadAotSummaries(summaries: () => any[]) { this._delegate.loadAotSummaries(summaries); }
|
||||
hasAotSummary(ref: Type<any>): boolean { return this._delegate.hasAotSummary(ref); }
|
||||
getComponentFactory<T>(component: Type<T>): ComponentFactory<T> {
|
||||
|
|
|
@ -57,10 +57,6 @@ export class TestingCompilerImpl implements TestingCompiler {
|
|||
return this._compiler.compileModuleAndAllComponentsAsync(moduleType);
|
||||
}
|
||||
|
||||
getNgContentSelectors(component: Type<any>): string[] {
|
||||
return this._compiler.getNgContentSelectors(component);
|
||||
}
|
||||
|
||||
getComponentFactory<T>(component: Type<T>): ComponentFactory<T> {
|
||||
return this._compiler.getComponentFactory(component);
|
||||
}
|
||||
|
|
|
@ -182,7 +182,6 @@ export declare class Compiler {
|
|||
compileModuleAndAllComponentsSync<T>(moduleType: Type<T>): ModuleWithComponentFactories<T>;
|
||||
compileModuleAsync<T>(moduleType: Type<T>): Promise<NgModuleFactory<T>>;
|
||||
compileModuleSync<T>(moduleType: Type<T>): NgModuleFactory<T>;
|
||||
/** @deprecated */ getNgContentSelectors(component: Type<any>): string[];
|
||||
}
|
||||
|
||||
/** @experimental */
|
||||
|
|
Loading…
Reference in New Issue