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.
This commit is contained in:
Chuck Jazdzewski 2016-08-12 17:44:44 -07:00 committed by vikerman
parent bb7221f922
commit 156a52e390
2 changed files with 12 additions and 57 deletions

View File

@ -19,9 +19,7 @@ import {ViewEncapsulation} from './view';
*/ */
export interface DirectiveMetadataType { export interface DirectiveMetadataType {
selector?: string; selector?: string;
properties?: string[];
inputs?: string[]; inputs?: string[];
events?: string[];
outputs?: string[]; outputs?: string[];
host?: {[key: string]: string}; host?: {[key: string]: string};
providers?: any[]; providers?: any[];
@ -492,18 +490,8 @@ export class DirectiveMetadata extends InjectableMetadata implements DirectiveMe
* ``` * ```
* *
*/ */
get inputs(): string[] { get inputs(): string[] { return this._inputs; }
return isPresent(this._properties) && this._properties.length > 0 ? this._properties :
this._inputs;
}
/**
* Use `inputs` instead
*
* @deprecated
*/
get properties(): string[] { return this.inputs; }
private _inputs: string[]; private _inputs: string[];
private _properties: string[];
/** /**
* Enumerates the set of event-bound output properties. * Enumerates the set of event-bound output properties.
@ -550,17 +538,8 @@ export class DirectiveMetadata extends InjectableMetadata implements DirectiveMe
* ``` * ```
* *
*/ */
get outputs(): string[] { get outputs(): string[] { return this._outputs; }
return isPresent(this._events) && this._events.length > 0 ? this._events : this._outputs;
}
/**
* Use `outputs` instead
*
* @deprecated
*/
get events(): string[] { return this.outputs; }
private _outputs: string[]; private _outputs: string[];
private _events: string[];
/** /**
* Specify the events, actions, properties and attributes related to the host element. * 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}; queries: {[key: string]: any};
constructor( constructor(
{selector, inputs, outputs, properties, events, host, providers, exportAs, {selector, inputs, outputs, host, providers, exportAs, queries}: DirectiveMetadataType = {}) {
queries}: DirectiveMetadataType = {}) {
super(); super();
this.selector = selector; this.selector = selector;
this._inputs = inputs; this._inputs = inputs;
this._properties = properties;
this._outputs = outputs; this._outputs = outputs;
this._events = events;
this.host = host; this.host = host;
this.exportAs = exportAs; this.exportAs = exportAs;
this.queries = queries; this.queries = queries;
@ -1022,34 +998,17 @@ export class ComponentMetadata extends DirectiveMetadata implements ComponentMet
*/ */
entryComponents: Array<Type<any>|any[]>; entryComponents: Array<Type<any>|any[]>;
constructor({selector, constructor({selector, inputs, outputs,
inputs, host, exportAs, moduleId,
outputs, providers, viewProviders, changeDetection = ChangeDetectionStrategy.Default,
properties, queries, templateUrl, template,
events, styleUrls, styles, animations,
host, directives, pipes, encapsulation,
exportAs, interpolation, entryComponents}: ComponentMetadataType = {}) {
moduleId,
providers,
viewProviders,
changeDetection = ChangeDetectionStrategy.Default,
queries,
templateUrl,
template,
styleUrls,
styles,
animations,
directives,
pipes,
encapsulation,
interpolation,
entryComponents}: ComponentMetadataType = {}) {
super({ super({
selector: selector, selector: selector,
inputs: inputs, inputs: inputs,
outputs: outputs, outputs: outputs,
properties: properties,
events: events,
host: host, host: host,
exportAs: exportAs, exportAs: exportAs,
providers: providers, providers: providers,

View File

@ -310,7 +310,7 @@ export declare class ComponentMetadata extends DirectiveMetadata implements Comp
template: string; template: string;
templateUrl: string; templateUrl: string;
viewProviders: any[]; 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 */ /** @stable */
@ -497,20 +497,18 @@ export interface DirectiveDecorator extends TypeDecorator {
/** @stable */ /** @stable */
export declare class DirectiveMetadata extends InjectableMetadata implements DirectiveMetadataType { export declare class DirectiveMetadata extends InjectableMetadata implements DirectiveMetadataType {
/** @deprecated */ events: string[];
exportAs: string; exportAs: string;
host: { host: {
[key: string]: string; [key: string]: string;
}; };
inputs: string[]; inputs: string[];
outputs: string[]; outputs: string[];
/** @deprecated */ properties: string[];
providers: any[]; providers: any[];
queries: { queries: {
[key: string]: any; [key: string]: any;
}; };
selector: string; selector: string;
constructor({selector, inputs, outputs, properties, events, host, providers, exportAs, queries}?: DirectiveMetadataType); constructor({selector, inputs, outputs, host, providers, exportAs, queries}?: DirectiveMetadataType);
} }
/** @stable */ /** @stable */
@ -521,14 +519,12 @@ export interface DirectiveMetadataFactory {
/** @experimental */ /** @experimental */
export interface DirectiveMetadataType { export interface DirectiveMetadataType {
events?: string[];
exportAs?: string; exportAs?: string;
host?: { host?: {
[key: string]: string; [key: string]: string;
}; };
inputs?: string[]; inputs?: string[];
outputs?: string[]; outputs?: string[];
properties?: string[];
providers?: any[]; providers?: any[];
queries?: { queries?: {
[key: string]: any; [key: string]: any;