fix(query): the view should not be visible to @Query.

@ViewQuery is the correct way to query the view template.
This commit is contained in:
Rado Kirov
2015-07-27 15:56:32 -07:00
parent 448ca384cc
commit 1d4502944c
2 changed files with 10 additions and 4 deletions

View File

@ -658,11 +658,14 @@ export class ElementInjector extends TreeNode<ElementInjector> implements Depend
}
private _addViewQueries(host: ElementInjector): void {
if (isPresent(host._query0) && host._query0.originator == host)
if (isPresent(host._query0) && host._query0.originator == host &&
host._query0.query.isViewQuery)
this._addViewQuery(host._query0);
if (isPresent(host._query1) && host._query1.originator == host)
if (isPresent(host._query1) && host._query1.originator == host &&
host._query1.query.isViewQuery)
this._addViewQuery(host._query1);
if (isPresent(host._query2) && host._query2.originator == host)
if (isPresent(host._query2) && host._query2.originator == host &&
host._query2.query.isViewQuery)
this._addViewQuery(host._query2);
}