fix(query): do not visit dehydrated injectors.

This commit is contained in:
Rado Kirov
2015-08-14 16:02:50 -07:00
committed by Igor Minar
parent 4845583dcf
commit 6c9e712c34
2 changed files with 21 additions and 3 deletions

View File

@ -486,11 +486,11 @@ export class ElementInjector extends TreeNode<ElementInjector> implements Depend
this._addDirectivesToQueries();
this._addVarBindingsToQueries();
this.hydrated = true;
// TODO(rado): optimize this call, if view queries are not moved around,
// simply appending to the query list is faster than updating.
this._updateViewQueries();
this.hydrated = true;
}
private _updateViewQueries() {
@ -1164,7 +1164,7 @@ export class QueryRef {
}
visit(inj: ElementInjector, aggregator: any[]): void {
if (isBlank(inj) || !inj._hasQuery(this)) return;
if (isBlank(inj) || !inj._hasQuery(this) || !inj.hydrated) return;
if (this.query.isVarBindingQuery) {
this._aggregateVariableBindings(inj, aggregator);