@ -10,11 +10,13 @@ import {
|
||||
HostBindingMetadata,
|
||||
HostListenerMetadata,
|
||||
ContentChildrenMetadata,
|
||||
ViewChildrenMetadata
|
||||
ViewChildrenMetadata,
|
||||
ContentChildMetadata,
|
||||
ViewChildMetadata
|
||||
} from 'angular2/src/core/metadata';
|
||||
import {reflector} from 'angular2/src/core/reflection/reflection';
|
||||
|
||||
/**
|
||||
/*
|
||||
* Resolve a `Type` for {@link DirectiveMetadata}.
|
||||
*
|
||||
* This interface can be overridden by the application developer to create custom behavior.
|
||||
@ -86,6 +88,14 @@ export class DirectiveResolver {
|
||||
if (a instanceof ViewChildrenMetadata) {
|
||||
queries[propName] = a;
|
||||
}
|
||||
|
||||
if (a instanceof ContentChildMetadata) {
|
||||
queries[propName] = a;
|
||||
}
|
||||
|
||||
if (a instanceof ViewChildMetadata) {
|
||||
queries[propName] = a;
|
||||
}
|
||||
});
|
||||
});
|
||||
return this._merge(dm, properties, events, host, queries);
|
||||
|
@ -967,7 +967,11 @@ export class QueryRef {
|
||||
// TODO delete the check once only field queries are supported
|
||||
if (isPresent(this.dirIndex)) {
|
||||
var dir = this.originator.getDirectiveAtIndex(this.dirIndex);
|
||||
this.setter(dir, this.list);
|
||||
if (this.query.first) {
|
||||
this.setter(dir, this.list.length > 0 ? this.list.first : null);
|
||||
} else {
|
||||
this.setter(dir, this.list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user