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:
@ -35,7 +35,7 @@ import {
|
||||
asyncRouteDataCmp
|
||||
} from './fixture_components';
|
||||
|
||||
function getLinkElement(rtc: ComponentFixture) {
|
||||
function getLinkElement(rtc: ComponentFixture<any>) {
|
||||
return rtc.debugElement.query(By.css('a')).nativeElement;
|
||||
}
|
||||
|
||||
|
@ -30,13 +30,13 @@ import {
|
||||
import {specs, compile, clickOnElement, getHref} from '../util';
|
||||
import {BaseException} from 'angular2/src/facade/exceptions';
|
||||
|
||||
function getLinkElement(rtc: ComponentFixture, linkIndex: number = 0) {
|
||||
function getLinkElement(rtc: ComponentFixture<any>, linkIndex: number = 0) {
|
||||
return rtc.debugElement.queryAll(By.css('a'))[linkIndex].nativeElement;
|
||||
}
|
||||
|
||||
function auxRoutes() {
|
||||
var tcb: TestComponentBuilder;
|
||||
var fixture: ComponentFixture;
|
||||
var fixture: ComponentFixture<any>;
|
||||
var rtr;
|
||||
|
||||
beforeEach(inject([TestComponentBuilder, Router], (tcBuilder, router) => {
|
||||
@ -139,7 +139,7 @@ function auxRoutes() {
|
||||
|
||||
function auxRoutesWithAPrimaryRoute() {
|
||||
var tcb: TestComponentBuilder;
|
||||
var fixture: ComponentFixture;
|
||||
var fixture: ComponentFixture<any>;
|
||||
var rtr;
|
||||
|
||||
beforeEach(inject([TestComponentBuilder, Router], (tcBuilder, router) => {
|
||||
|
@ -142,7 +142,7 @@ export class RedirectToParentCmp {
|
||||
@Component({selector: 'dynamic-loader-cmp', template: `{ <div #viewport></div> }`})
|
||||
@RouteConfig([new Route({path: '/', component: HelloCmp})])
|
||||
export class DynamicLoaderCmp {
|
||||
private _componentRef: ComponentRef = null;
|
||||
private _componentRef: ComponentRef<any> = null;
|
||||
|
||||
@ViewChild('viewport', {read: ViewContainerRef}) viewport: ViewContainerRef;
|
||||
|
||||
|
@ -30,7 +30,7 @@ import {
|
||||
import {PromiseWrapper} from 'angular2/src/facade/async';
|
||||
|
||||
|
||||
function getLinkElement(rtc: ComponentFixture) {
|
||||
function getLinkElement(rtc: ComponentFixture<any>) {
|
||||
return rtc.debugElement.query(By.css('a')).nativeElement;
|
||||
}
|
||||
|
||||
@ -431,7 +431,7 @@ function syncRoutesWithSyncChildrenWithDefaultRoutesWithoutParams() {
|
||||
}
|
||||
|
||||
function syncRoutesWithDynamicComponents() {
|
||||
var fixture: ComponentFixture;
|
||||
var fixture: ComponentFixture<any>;
|
||||
var tcb: TestComponentBuilder;
|
||||
var rtr: Router;
|
||||
|
||||
|
Reference in New Issue
Block a user