diff --git a/packages/common/src/location/platform_location.ts b/packages/common/src/location/platform_location.ts index 0f5cb5f32e..00ec4a4919 100644 --- a/packages/common/src/location/platform_location.ts +++ b/packages/common/src/location/platform_location.ts @@ -34,9 +34,9 @@ export abstract class PlatformLocation { abstract onPopState(fn: LocationChangeListener): void; abstract onHashChange(fn: LocationChangeListener): void; - abstract get pathname(): string; - abstract get search(): string; - abstract get hash(): string; + readonly pathname: string; + readonly search: string; + readonly hash: string; abstract replaceState(state: any, title: string, url: string): void; diff --git a/packages/core/src/di/reflective_injector.ts b/packages/core/src/di/reflective_injector.ts index 1d4999fd1c..eac4c8b1a5 100644 --- a/packages/core/src/di/reflective_injector.ts +++ b/packages/core/src/di/reflective_injector.ts @@ -163,7 +163,7 @@ export abstract class ReflectiveInjector implements Injector { * expect(child.parent).toBe(parent); * ``` */ - abstract get parent(): Injector|null; + readonly parent: Injector|null; /** * Resolves an array of providers and creates a child injector from those providers. diff --git a/packages/core/src/linker/component_factory.ts b/packages/core/src/linker/component_factory.ts index 7e7ac7c519..06cdbcf35b 100644 --- a/packages/core/src/linker/component_factory.ts +++ b/packages/core/src/linker/component_factory.ts @@ -26,32 +26,32 @@ export abstract class ComponentRef { /** * Location of the Host Element of this Component Instance. */ - abstract get location(): ElementRef; + readonly location: ElementRef; /** * The injector on which the component instance exists. */ - abstract get injector(): Injector; + readonly injector: Injector; /** * The instance of the Component. */ - abstract get instance(): C; + readonly instance: C; /** * The {@link ViewRef} of the Host View of this Component instance. */ - abstract get hostView(): ViewRef; + readonly hostView: ViewRef; /** * The {@link ChangeDetectorRef} of the Component instance. */ - abstract get changeDetectorRef(): ChangeDetectorRef; + readonly changeDetectorRef: ChangeDetectorRef; /** * The component type. */ - abstract get componentType(): Type; + readonly componentType: Type; /** * Destroys the component instance and all of the data structures associated with it. @@ -68,20 +68,20 @@ export abstract class ComponentRef { * @stable */ export abstract class ComponentFactory { - abstract get selector(): string; - abstract get componentType(): Type; + readonly selector: string; + readonly componentType: Type; /** * selector for all elements in the component. */ - abstract get ngContentSelectors(): string[]; + readonly ngContentSelectors: string[]; /** * the inputs of the component. */ - abstract get inputs(): {propName: string, templateName: string}[]; + readonly inputs: {propName: string, templateName: string}[]; /** * the outputs of the component. */ - abstract get outputs(): {propName: string, templateName: string}[]; + readonly outputs: {propName: string, templateName: string}[]; /** * Creates a new component. */ diff --git a/packages/core/src/linker/ng_module_factory.ts b/packages/core/src/linker/ng_module_factory.ts index 0e4925f806..4f20f0c4c3 100644 --- a/packages/core/src/linker/ng_module_factory.ts +++ b/packages/core/src/linker/ng_module_factory.ts @@ -24,18 +24,18 @@ export abstract class NgModuleRef { /** * The injector that contains all of the providers of the NgModule. */ - abstract get injector(): Injector; + readonly injector: Injector; /** * The ComponentFactoryResolver to get hold of the ComponentFactories * declared in the `entryComponents` property of the module. */ - abstract get componentFactoryResolver(): ComponentFactoryResolver; + readonly componentFactoryResolver: ComponentFactoryResolver; /** * The NgModule instance. */ - abstract get instance(): T; + readonly instance: T; /** * Destroys the module instance and all of the data structures associated with it. @@ -58,6 +58,6 @@ export interface InternalNgModuleRef extends NgModuleRef { * @experimental */ export abstract class NgModuleFactory { - abstract get moduleType(): Type; + readonly moduleType: Type; abstract create(parentInjector: Injector|null): NgModuleRef; } diff --git a/packages/core/src/linker/template_ref.ts b/packages/core/src/linker/template_ref.ts index 748342e5ac..ee63286426 100644 --- a/packages/core/src/linker/template_ref.ts +++ b/packages/core/src/linker/template_ref.ts @@ -36,7 +36,7 @@ export abstract class TemplateRef { * */ // TODO(i): rename to anchor or location - abstract get elementRef(): ElementRef; + readonly elementRef: ElementRef; abstract createEmbeddedView(context: C): EmbeddedViewRef; } diff --git a/packages/core/src/linker/view_container_ref.ts b/packages/core/src/linker/view_container_ref.ts index 8a031f8cfe..b9c23b0e39 100644 --- a/packages/core/src/linker/view_container_ref.ts +++ b/packages/core/src/linker/view_container_ref.ts @@ -37,11 +37,11 @@ export abstract class ViewContainerRef { * Anchor element that specifies the location of this container in the containing View. * */ - abstract get element(): ElementRef; + readonly element: ElementRef; - abstract get injector(): Injector; + readonly injector: Injector; - abstract get parentInjector(): Injector; + readonly parentInjector: Injector; /** * Destroys all Views in this container. @@ -56,7 +56,7 @@ export abstract class ViewContainerRef { /** * Returns the number of Views currently attached to this container. */ - abstract get length(): number; + readonly length: number; /** * Instantiates an Embedded View based on the {@link TemplateRef `templateRef`} and inserts it diff --git a/packages/core/src/linker/view_ref.ts b/packages/core/src/linker/view_ref.ts index 3f110bd3ff..33ae2df15e 100644 --- a/packages/core/src/linker/view_ref.ts +++ b/packages/core/src/linker/view_ref.ts @@ -19,7 +19,7 @@ export abstract class ViewRef extends ChangeDetectorRef { */ abstract destroy(): void; - abstract get destroyed(): boolean; + readonly destroyed: boolean; abstract onDestroy(callback: Function): any /** TODO #9100 */; } @@ -79,9 +79,9 @@ export abstract class ViewRef extends ChangeDetectorRef { * @experimental */ export abstract class EmbeddedViewRef extends ViewRef { - abstract get context(): C; + readonly context: C; - abstract get rootNodes(): any[]; + readonly rootNodes: any[]; } export interface InternalViewRef extends ViewRef { diff --git a/packages/core/src/render/api.ts b/packages/core/src/render/api.ts index a741f5224e..e90cef3f2f 100644 --- a/packages/core/src/render/api.ts +++ b/packages/core/src/render/api.ts @@ -23,12 +23,12 @@ export class RenderComponentType { * @deprecated Debug info is handeled internally in the view engine now. */ export abstract class RenderDebugInfo { - abstract get injector(): Injector; - abstract get component(): any; - abstract get providerTokens(): any[]; - abstract get references(): {[key: string]: any}; - abstract get context(): any; - abstract get source(): string; + readonly injector: Injector; + readonly component: any; + readonly providerTokens: any[]; + readonly references: {[key: string]: any}; + readonly context: any; + readonly source: string; } /** @@ -149,7 +149,7 @@ export abstract class Renderer2 { * This field can be used to store arbitrary data on this renderer instance. * This is useful for renderers that delegate to other renderers. */ - abstract get data(): {[key: string]: any}; + readonly data: {[key: string]: any}; abstract destroy(): void; abstract createElement(name: string, namespace?: string|null): any; diff --git a/packages/core/src/view/types.ts b/packages/core/src/view/types.ts index 081a49bfc3..53f92b036e 100644 --- a/packages/core/src/view/types.ts +++ b/packages/core/src/view/types.ts @@ -479,15 +479,15 @@ export interface RootData { } export abstract class DebugContext { - abstract get view(): ViewData; - abstract get nodeIndex(): number|null; - abstract get injector(): Injector; - abstract get component(): any; - abstract get providerTokens(): any[]; - abstract get references(): {[key: string]: any}; - abstract get context(): any; - abstract get componentRenderElement(): any; - abstract get renderNode(): any; + readonly view: ViewData; + readonly nodeIndex: number|null; + readonly injector: Injector; + readonly component: any; + readonly providerTokens: any[]; + readonly references: {[key: string]: any}; + readonly context: any; + readonly componentRenderElement: any; + readonly renderNode: any; abstract logError(console: Console, ...values: any[]): void; } diff --git a/packages/forms/src/directives/abstract_control_directive.ts b/packages/forms/src/directives/abstract_control_directive.ts index 54de8b0cc6..14cf0dc3c8 100644 --- a/packages/forms/src/directives/abstract_control_directive.ts +++ b/packages/forms/src/directives/abstract_control_directive.ts @@ -23,7 +23,7 @@ export abstract class AbstractControlDirective { * that backs this directive. Most properties fall through to that * instance. */ - abstract get control(): AbstractControl|null; + readonly control: AbstractControl|null; /** The value of the control. */ get value(): any { return this.control ? this.control.value : null; } diff --git a/tools/public_api_guard/common/common.d.ts b/tools/public_api_guard/common/common.d.ts index 9652694d09..0c8afbe022 100644 --- a/tools/public_api_guard/common/common.d.ts +++ b/tools/public_api_guard/common/common.d.ts @@ -392,9 +392,9 @@ export declare class PercentPipe implements PipeTransform { /** @stable */ export declare abstract class PlatformLocation { - readonly abstract hash: string; - readonly abstract pathname: string; - readonly abstract search: string; + readonly hash: string; + readonly pathname: string; + readonly search: string; abstract back(): void; abstract forward(): void; abstract getBaseHrefFromDOM(): string; diff --git a/tools/public_api_guard/core/core.d.ts b/tools/public_api_guard/core/core.d.ts index 51fe21bb95..f38ab03315 100644 --- a/tools/public_api_guard/core/core.d.ts +++ b/tools/public_api_guard/core/core.d.ts @@ -213,17 +213,17 @@ export interface ComponentDecorator { /** @stable */ export declare abstract class ComponentFactory { - readonly abstract componentType: Type; - readonly abstract inputs: { + readonly componentType: Type; + readonly inputs: { propName: string; templateName: string; }[]; - readonly abstract ngContentSelectors: string[]; - readonly abstract outputs: { + readonly ngContentSelectors: string[]; + readonly outputs: { propName: string; templateName: string; }[]; - readonly abstract selector: string; + readonly selector: string; abstract create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string | any, ngModule?: NgModuleRef): ComponentRef; } @@ -235,12 +235,12 @@ export declare abstract class ComponentFactoryResolver { /** @stable */ export declare abstract class ComponentRef { - readonly abstract changeDetectorRef: ChangeDetectorRef; - readonly abstract componentType: Type; - readonly abstract hostView: ViewRef; - readonly abstract injector: Injector; - readonly abstract instance: C; - readonly abstract location: ElementRef; + readonly changeDetectorRef: ChangeDetectorRef; + readonly componentType: Type; + readonly hostView: ViewRef; + readonly injector: Injector; + readonly instance: C; + readonly location: ElementRef; abstract destroy(): void; abstract onDestroy(callback: Function): void; } @@ -369,8 +369,8 @@ export declare class ElementRef { /** @experimental */ export declare abstract class EmbeddedViewRef extends ViewRef { - readonly abstract context: C; - readonly abstract rootNodes: any[]; + readonly context: C; + readonly rootNodes: any[]; } /** @stable */ @@ -597,7 +597,7 @@ export declare const NgModule: NgModuleDecorator; /** @experimental */ export declare abstract class NgModuleFactory { - readonly abstract moduleType: Type; + readonly moduleType: Type; abstract create(parentInjector: Injector | null): NgModuleRef; } @@ -608,9 +608,9 @@ export declare abstract class NgModuleFactoryLoader { /** @stable */ export declare abstract class NgModuleRef { - readonly abstract componentFactoryResolver: ComponentFactoryResolver; - readonly abstract injector: Injector; - readonly abstract instance: T; + readonly componentFactoryResolver: ComponentFactoryResolver; + readonly injector: Injector; + readonly instance: T; abstract destroy(): void; abstract onDestroy(callback: () => void): void; } @@ -738,7 +738,7 @@ export declare class QueryList { /** @deprecated */ export declare abstract class ReflectiveInjector implements Injector { - readonly abstract parent: Injector | null; + readonly parent: Injector | null; abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector; abstract get(token: any, notFoundValue?: any): any; abstract instantiateResolved(provider: ResolvedReflectiveProvider): any; @@ -795,7 +795,7 @@ export declare abstract class Renderer { /** @experimental */ export declare abstract class Renderer2 { - readonly abstract data: { + readonly data: { [key: string]: any; }; destroyNode: ((node: any) => void) | null; @@ -953,7 +953,7 @@ export declare abstract class SystemJsNgModuleLoaderConfig { /** @stable */ export declare abstract class TemplateRef { - readonly abstract elementRef: ElementRef; + readonly elementRef: ElementRef; abstract createEmbeddedView(context: C): EmbeddedViewRef; } @@ -1057,10 +1057,10 @@ export interface ViewChildrenDecorator { /** @stable */ export declare abstract class ViewContainerRef { - readonly abstract element: ElementRef; - readonly abstract injector: Injector; - readonly abstract length: number; - readonly abstract parentInjector: Injector; + readonly element: ElementRef; + readonly injector: Injector; + readonly length: number; + readonly parentInjector: Injector; abstract clear(): void; abstract createComponent(componentFactory: ComponentFactory, index?: number, injector?: Injector, projectableNodes?: any[][], ngModule?: NgModuleRef): ComponentRef; abstract createEmbeddedView(templateRef: TemplateRef, context?: C, index?: number): EmbeddedViewRef; @@ -1081,7 +1081,7 @@ export declare enum ViewEncapsulation { /** @stable */ export declare abstract class ViewRef extends ChangeDetectorRef { - readonly abstract destroyed: boolean; + readonly destroyed: boolean; abstract destroy(): void; abstract onDestroy(callback: Function): any; } diff --git a/tools/public_api_guard/forms/forms.d.ts b/tools/public_api_guard/forms/forms.d.ts index 7a478b028a..b89ef3e776 100644 --- a/tools/public_api_guard/forms/forms.d.ts +++ b/tools/public_api_guard/forms/forms.d.ts @@ -65,7 +65,7 @@ export declare abstract class AbstractControl { /** @stable */ export declare abstract class AbstractControlDirective { - readonly abstract control: AbstractControl | null; + readonly control: AbstractControl | null; readonly dirty: boolean | null; readonly disabled: boolean | null; readonly enabled: boolean | null;