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));
|
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 {
|
getComponentFactory(component: Type): object {
|
||||||
const summary = this._metadataResolver.getDirectiveSummary(component);
|
const summary = this._metadataResolver.getDirectiveSummary(component);
|
||||||
return summary.componentFactory as object;
|
return summary.componentFactory as object;
|
||||||
|
@ -69,16 +69,6 @@ export class Compiler {
|
|||||||
throw _throwError();
|
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.
|
* Clears all caches.
|
||||||
*/
|
*/
|
||||||
|
@ -71,9 +71,6 @@ export class CompilerImpl implements Compiler {
|
|||||||
componentFactories: result.componentFactories as ComponentFactory<any>[],
|
componentFactories: result.componentFactories as ComponentFactory<any>[],
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
getNgContentSelectors(component: Type<any>): string[] {
|
|
||||||
return this._delegate.getNgContentSelectors(component);
|
|
||||||
}
|
|
||||||
loadAotSummaries(summaries: () => any[]) { this._delegate.loadAotSummaries(summaries); }
|
loadAotSummaries(summaries: () => any[]) { this._delegate.loadAotSummaries(summaries); }
|
||||||
hasAotSummary(ref: Type<any>): boolean { return this._delegate.hasAotSummary(ref); }
|
hasAotSummary(ref: Type<any>): boolean { return this._delegate.hasAotSummary(ref); }
|
||||||
getComponentFactory<T>(component: Type<T>): ComponentFactory<T> {
|
getComponentFactory<T>(component: Type<T>): ComponentFactory<T> {
|
||||||
|
@ -57,10 +57,6 @@ export class TestingCompilerImpl implements TestingCompiler {
|
|||||||
return this._compiler.compileModuleAndAllComponentsAsync(moduleType);
|
return this._compiler.compileModuleAndAllComponentsAsync(moduleType);
|
||||||
}
|
}
|
||||||
|
|
||||||
getNgContentSelectors(component: Type<any>): string[] {
|
|
||||||
return this._compiler.getNgContentSelectors(component);
|
|
||||||
}
|
|
||||||
|
|
||||||
getComponentFactory<T>(component: Type<T>): ComponentFactory<T> {
|
getComponentFactory<T>(component: Type<T>): ComponentFactory<T> {
|
||||||
return this._compiler.getComponentFactory(component);
|
return this._compiler.getComponentFactory(component);
|
||||||
}
|
}
|
||||||
|
1
tools/public_api_guard/core/core.d.ts
vendored
1
tools/public_api_guard/core/core.d.ts
vendored
@ -182,7 +182,6 @@ export declare class Compiler {
|
|||||||
compileModuleAndAllComponentsSync<T>(moduleType: Type<T>): ModuleWithComponentFactories<T>;
|
compileModuleAndAllComponentsSync<T>(moduleType: Type<T>): ModuleWithComponentFactories<T>;
|
||||||
compileModuleAsync<T>(moduleType: Type<T>): Promise<NgModuleFactory<T>>;
|
compileModuleAsync<T>(moduleType: Type<T>): Promise<NgModuleFactory<T>>;
|
||||||
compileModuleSync<T>(moduleType: Type<T>): NgModuleFactory<T>;
|
compileModuleSync<T>(moduleType: Type<T>): NgModuleFactory<T>;
|
||||||
/** @deprecated */ getNgContentSelectors(component: Type<any>): string[];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @experimental */
|
/** @experimental */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user