feat(core): support properties and events in addition to inputs and outputs to make transition easier

Closes #4482
This commit is contained in:
vsavkin
2015-10-02 16:21:49 -07:00
committed by Victor Savkin
parent 5ea6dc844c
commit c9901c5fe0
8 changed files with 93 additions and 8 deletions

View File

@ -1,5 +1,5 @@
import {resolveForwardRef, Injectable} from 'angular2/src/core/di';
import {Type, isPresent, stringify} from 'angular2/src/core/facade/lang';
import {Type, isPresent, isBlank, stringify} from 'angular2/src/core/facade/lang';
import {BaseException} from 'angular2/src/core/facade/exceptions';
import {ListWrapper, StringMap, StringMapWrapper} from 'angular2/src/core/facade/collection';
import {
@ -110,6 +110,10 @@ export class DirectiveResolver {
var mergedQueries =
isPresent(dm.queries) ? StringMapWrapper.merge(dm.queries, queries) : queries;
// TODO: remove after migrating from properties to inputs
if (mergedInputs.length == 0 && isPresent(dm.properties)) mergedInputs = dm.properties;
if (mergedOutputs.length == 0 && isPresent(dm.events)) mergedOutputs = dm.events;
if (dm instanceof ComponentMetadata) {
return new ComponentMetadata({
selector: dm.selector,