refactor(core): type ComponentRef, ComponentFactory and ComponentFixture by the component type

BREAKING CHANGE:
- `ComponetRef`, `ComponentFactory`, `ComponentFixture` now all require a type
  parameter with the component type.
Closes #8361
This commit is contained in:
Tobias Bosch
2016-04-30 10:52:04 -07:00
parent 4e2c68354e
commit 6a0cbb8a57
48 changed files with 225 additions and 209 deletions

View File

@ -29,11 +29,11 @@ const CORE = [
'AfterViewInit',
'AfterViewInit.ngAfterViewInit():any',
'ApplicationRef',
'ApplicationRef.bootstrap(componentFactory:ComponentFactory):ComponentRef',
'ApplicationRef.bootstrap(componentFactory:ComponentFactory<C>):ComponentRef<C>',
'ApplicationRef.componentTypes:Type[]',
'ApplicationRef.dispose():void',
'ApplicationRef.injector:Injector',
'ApplicationRef.registerBootstrapListener(listener:(ref: ComponentRef) => void):void',
'ApplicationRef.registerBootstrapListener(listener:(ref: ComponentRef<any>) => void):void',
'ApplicationRef.registerDisposeListener(dispose:() => void):void',
'ApplicationRef.tick():void',
'ApplicationRef.run(callback:Function):any',
@ -74,7 +74,7 @@ const CORE = [
'CollectionChangeRecord.toString():string',
'ComponentResolver',
'ComponentResolver.clearCache():any',
'ComponentResolver.resolveComponent(componentType:Type):Promise<ComponentFactory>',
'ComponentResolver.resolveComponent(componentType:Type):Promise<ComponentFactory<any>>',
'ComponentDecorator',
'ComponentDecorator.View(obj:{templateUrl?:string, template?:string, directives?:Array<Type|any[]>, pipes?:Array<Type|any[]>, renderer?:string, styles?:string[], styleUrls?:string[]}):ViewDecorator',
'ComponentMetadataFactory',
@ -91,10 +91,10 @@ const CORE = [
'ComponentMetadata.templateUrl:string',
'ComponentMetadata.viewBindings:any[]',
'ComponentMetadata.viewProviders:any[]',
'ComponentRef',
'ComponentRef<C>',
'ComponentRef.componentType:Type',
'ComponentRef.injector:Injector',
'ComponentRef.instance:any',
'ComponentRef.instance:C',
'ComponentRef.location:ElementRef',
'ComponentRef.destroy():void',
'ComponentRef.hostView:ViewRef',
@ -159,8 +159,8 @@ const CORE = [
'DoCheck',
'DoCheck.ngDoCheck():any',
'DynamicComponentLoader',
'DynamicComponentLoader.loadAsRoot(type:Type, overrideSelectorOrNode:string|any, injector:Injector, onDispose:() => void, projectableNodes:any[][]):Promise<ComponentRef>',
'DynamicComponentLoader.loadNextToLocation(type:Type, location:ViewContainerRef, providers:ResolvedReflectiveProvider[], projectableNodes:any[][]):Promise<ComponentRef>',
'DynamicComponentLoader.loadAsRoot(type:Type, overrideSelectorOrNode:string|any, injector:Injector, onDispose:() => void, projectableNodes:any[][]):Promise<ComponentRef<any>>',
'DynamicComponentLoader.loadNextToLocation(type:Type, location:ViewContainerRef, providers:ResolvedReflectiveProvider[], projectableNodes:any[][]):Promise<ComponentRef<any>>',
'ElementRef',
'ElementRef.nativeElement:any',
'ElementRef.constructor(nativeElement:any)',
@ -192,10 +192,10 @@ const CORE = [
'HostListenerMetadata.constructor(eventName:string, args:string[])',
'HostMetadata',
'HostMetadata.toString():string',
'ComponentFactory',
'ComponentFactory<C>',
'ComponentFactory.componentType:Type',
'ComponentFactory.constructor(selector:string, _viewFactory:Function, _componentType:Type)',
'ComponentFactory.create(injector:Injector, projectableNodes:any[][], rootSelectorOrNode:string|any):ComponentRef',
'ComponentFactory.create(injector:Injector, projectableNodes:any[][], rootSelectorOrNode:string|any):ComponentRef<C>',
'InjectMetadataFactory',
'InjectMetadata',
'InjectMetadata.constructor(token:any)',
@ -445,8 +445,8 @@ const CORE = [
'ViewChildrenMetadata.constructor(_selector:Type|string, {read=null}:{read?:any})',
'ViewContainerRef',
'ViewContainerRef.clear():void',
'ViewContainerRef.createEmbeddedView(templateRef:TemplateRef<any>, context:any, index:number):EmbeddedViewRef<any>',
'ViewContainerRef.createComponent(componentFactory:ComponentFactory, index:number, injector:Injector, projectableNodes:any[][]):ComponentRef',
'ViewContainerRef.createEmbeddedView(templateRef:TemplateRef<C>, context:C, index:number):EmbeddedViewRef<C>',
'ViewContainerRef.createComponent(componentFactory:ComponentFactory<C>, index:number, injector:Injector, projectableNodes:any[][]):ComponentRef<C>',
'ViewContainerRef.detach(index:number):ViewRef',
'ViewContainerRef.element:ElementRef',
'ViewContainerRef.injector:Injector',
@ -503,8 +503,8 @@ const CORE = [
'createNgZone():NgZone',
'enableProdMode():any',
'forwardRef(forwardRefFn:ForwardRefFn):Type',
'coreBootstrap(injector:Injector, componentFactory:ComponentFactory):ComponentRef',
'coreLoadAndBootstrap(injector:Injector, componentType:Type):Promise<ComponentRef>',
'coreBootstrap(injector:Injector, componentFactory:ComponentFactory<C>):ComponentRef<C>',
'coreLoadAndBootstrap(injector:Injector, componentType:Type):Promise<ComponentRef<any>>',
'assertPlatform(requiredToken:any):PlatformRef',
'createPlatform(injector:Injector):PlatformRef',
'disposePlatform():void',
@ -1208,13 +1208,13 @@ const BROWSER = [
'Title',
'Title.getTitle():string',
'Title.setTitle(newTitle:string):any',
'bootstrapStatic(appComponentType:Type, customProviders:Array<any>, initReflector:Function):Promise<ComponentRef>',
'bootstrapStatic(appComponentType:Type, customProviders:Array<any>, initReflector:Function):Promise<ComponentRef<any>>',
'const BROWSER_APP_PROVIDERS:Array<any>',
'const BROWSER_PROVIDERS:Array<any>',
'const ELEMENT_PROBE_PROVIDERS:any[]',
'const ELEMENT_PROBE_PROVIDERS_PROD_MODE:any[]',
'disableDebugTools():void',
'enableDebugTools(ref:ComponentRef):void',
'enableDebugTools(ref:ComponentRef<any>):void',
'inspectNativeElement(element:any):DebugNode',
'browserStaticPlatform():PlatformRef'
];