feat(upgrade): use ComponentFactory.inputs/outputs/ngContentSelectors

DEPRECATION:
- the arguments `inputs` / `outputs` / `ngContentSelectors` of `downgradeComponent`
  are no longer used as Angular calculates these automatically now.
- Compiler.getNgContentSelectors is deprecated. Use
  ComponentFactory.ngContentSelectors instead.
This commit is contained in:
Tobias Bosch
2017-03-14 14:55:37 -07:00
committed by Chuck Jazdzewski
parent 1171f91a80
commit a3e32fb7e1
22 changed files with 94 additions and 418 deletions

View File

@ -193,7 +193,7 @@ 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>;
getNgContentSelectors(component: Type<any>): string[];
/** @deprecated */ getNgContentSelectors(component: Type<any>): string[];
}
/** @experimental */
@ -226,6 +226,15 @@ export interface ComponentDecorator {
/** @stable */
export declare abstract class ComponentFactory<C> {
readonly abstract componentType: Type<any>;
readonly abstract inputs: {
propName: string;
templateName: string;
}[];
readonly abstract ngContentSelectors: string[];
readonly abstract outputs: {
propName: string;
templateName: string;
}[];
readonly abstract selector: string;
abstract create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string | any, ngModule?: NgModuleRef<any>): ComponentRef<C>;
}