feat(query): notify on changes
This commit is contained in:
@ -26,7 +26,6 @@ export class BaseQueryList<T> {
|
||||
this._dirty = true;
|
||||
}
|
||||
|
||||
// TODO(rado): hook up with change detection after #995.
|
||||
fireCallbacks() {
|
||||
if (this._dirty) {
|
||||
ListWrapper.forEach(this._callbacks, (c) => c());
|
||||
|
@ -707,6 +707,15 @@ export class ElementInjector extends TreeNode<ElementInjector> {
|
||||
}
|
||||
}
|
||||
|
||||
onAllChangesDone(): void {
|
||||
if (isPresent(this._query0) && this._query0.originator === this)
|
||||
this._query0.list.fireCallbacks();
|
||||
if (isPresent(this._query1) && this._query1.originator === this)
|
||||
this._query1.list.fireCallbacks();
|
||||
if (isPresent(this._query2) && this._query2.originator === this)
|
||||
this._query2.list.fireCallbacks();
|
||||
}
|
||||
|
||||
hydrate(injector: Injector, host: ElementInjector, preBuiltObjects: PreBuiltObjects): void {
|
||||
var p = this._proto;
|
||||
|
||||
|
@ -111,6 +111,13 @@ export class AppView implements ChangeDispatcher, EventDispatcher {
|
||||
}
|
||||
}
|
||||
|
||||
notifyOnAllChangesDone(): void {
|
||||
var ei = this.elementInjectors;
|
||||
for (var i = ei.length - 1; i >= 0; i--) {
|
||||
if (isPresent(ei[i])) ei[i].onAllChangesDone();
|
||||
}
|
||||
}
|
||||
|
||||
getDirectiveFor(directive: DirectiveIndex) {
|
||||
var elementInjector = this.elementInjectors[directive.elementIndex];
|
||||
return elementInjector.getDirectiveAtIndex(directive.directiveIndex);
|
||||
|
Reference in New Issue
Block a user