From 156a52e390256b00ae7c1fe1f80281cb1d1fe773 Mon Sep 17 00:00:00 2001 From: Chuck Jazdzewski Date: Fri, 12 Aug 2016 17:44:44 -0700 Subject: [PATCH] refactor(core): Removed deprecated properties and events from metadata (#10753) BREAKING CHANGE: previously deprecated DirectiveMetadataType#properties and DirectiveMetadataType#events were removed; see deprecation notice for migration instructions. --- .../@angular/core/src/metadata/directives.ts | 61 +++---------------- tools/public_api_guard/core/index.d.ts | 8 +-- 2 files changed, 12 insertions(+), 57 deletions(-) diff --git a/modules/@angular/core/src/metadata/directives.ts b/modules/@angular/core/src/metadata/directives.ts index cb2b157a04..77b0bf0b2e 100644 --- a/modules/@angular/core/src/metadata/directives.ts +++ b/modules/@angular/core/src/metadata/directives.ts @@ -19,9 +19,7 @@ import {ViewEncapsulation} from './view'; */ export interface DirectiveMetadataType { selector?: string; - properties?: string[]; inputs?: string[]; - events?: string[]; outputs?: string[]; host?: {[key: string]: string}; providers?: any[]; @@ -492,18 +490,8 @@ export class DirectiveMetadata extends InjectableMetadata implements DirectiveMe * ``` * */ - get inputs(): string[] { - return isPresent(this._properties) && this._properties.length > 0 ? this._properties : - this._inputs; - } - /** - * Use `inputs` instead - * - * @deprecated - */ - get properties(): string[] { return this.inputs; } + get inputs(): string[] { return this._inputs; } private _inputs: string[]; - private _properties: string[]; /** * Enumerates the set of event-bound output properties. @@ -550,17 +538,8 @@ export class DirectiveMetadata extends InjectableMetadata implements DirectiveMe * ``` * */ - get outputs(): string[] { - return isPresent(this._events) && this._events.length > 0 ? this._events : this._outputs; - } - /** - * Use `outputs` instead - * - * @deprecated - */ - get events(): string[] { return this.outputs; } + get outputs(): string[] { return this._outputs; } private _outputs: string[]; - private _events: string[]; /** * Specify the events, actions, properties and attributes related to the host element. @@ -764,14 +743,11 @@ export class DirectiveMetadata extends InjectableMetadata implements DirectiveMe queries: {[key: string]: any}; constructor( - {selector, inputs, outputs, properties, events, host, providers, exportAs, - queries}: DirectiveMetadataType = {}) { + {selector, inputs, outputs, host, providers, exportAs, queries}: DirectiveMetadataType = {}) { super(); this.selector = selector; this._inputs = inputs; - this._properties = properties; this._outputs = outputs; - this._events = events; this.host = host; this.exportAs = exportAs; this.queries = queries; @@ -1022,34 +998,17 @@ export class ComponentMetadata extends DirectiveMetadata implements ComponentMet */ entryComponents: Array|any[]>; - constructor({selector, - inputs, - outputs, - properties, - events, - host, - exportAs, - moduleId, - providers, - viewProviders, - changeDetection = ChangeDetectionStrategy.Default, - queries, - templateUrl, - template, - styleUrls, - styles, - animations, - directives, - pipes, - encapsulation, - interpolation, - entryComponents}: ComponentMetadataType = {}) { + constructor({selector, inputs, outputs, + host, exportAs, moduleId, + providers, viewProviders, changeDetection = ChangeDetectionStrategy.Default, + queries, templateUrl, template, + styleUrls, styles, animations, + directives, pipes, encapsulation, + interpolation, entryComponents}: ComponentMetadataType = {}) { super({ selector: selector, inputs: inputs, outputs: outputs, - properties: properties, - events: events, host: host, exportAs: exportAs, providers: providers, diff --git a/tools/public_api_guard/core/index.d.ts b/tools/public_api_guard/core/index.d.ts index 1c83bfd033..49cdda496d 100644 --- a/tools/public_api_guard/core/index.d.ts +++ b/tools/public_api_guard/core/index.d.ts @@ -310,7 +310,7 @@ export declare class ComponentMetadata extends DirectiveMetadata implements Comp template: string; templateUrl: string; viewProviders: any[]; - constructor({selector, inputs, outputs, properties, events, host, exportAs, moduleId, providers, viewProviders, changeDetection, queries, templateUrl, template, styleUrls, styles, animations, directives, pipes, encapsulation, interpolation, entryComponents}?: ComponentMetadataType); + constructor({selector, inputs, outputs, host, exportAs, moduleId, providers, viewProviders, changeDetection, queries, templateUrl, template, styleUrls, styles, animations, directives, pipes, encapsulation, interpolation, entryComponents}?: ComponentMetadataType); } /** @stable */ @@ -497,20 +497,18 @@ export interface DirectiveDecorator extends TypeDecorator { /** @stable */ export declare class DirectiveMetadata extends InjectableMetadata implements DirectiveMetadataType { - /** @deprecated */ events: string[]; exportAs: string; host: { [key: string]: string; }; inputs: string[]; outputs: string[]; - /** @deprecated */ properties: string[]; providers: any[]; queries: { [key: string]: any; }; selector: string; - constructor({selector, inputs, outputs, properties, events, host, providers, exportAs, queries}?: DirectiveMetadataType); + constructor({selector, inputs, outputs, host, providers, exportAs, queries}?: DirectiveMetadataType); } /** @stable */ @@ -521,14 +519,12 @@ export interface DirectiveMetadataFactory { /** @experimental */ export interface DirectiveMetadataType { - events?: string[]; exportAs?: string; host?: { [key: string]: string; }; inputs?: string[]; outputs?: string[]; - properties?: string[]; providers?: any[]; queries?: { [key: string]: any;