feat(query): notify on changes
This commit is contained in:
@ -324,6 +324,12 @@ export function main() {
|
||||
});
|
||||
});
|
||||
|
||||
it('should notify the dispatcher on all changes done', () => {
|
||||
var val = _createChangeDetector('name', new Person('bob'));
|
||||
val.changeDetector.detectChanges();
|
||||
expect(val.dispatcher.onAllChangesDoneCalled).toEqual(true);
|
||||
});
|
||||
|
||||
describe('updating directives', () => {
|
||||
var directive1;
|
||||
var directive2;
|
||||
@ -975,6 +981,7 @@ class FakeDirectives {
|
||||
class TestDispatcher extends ChangeDispatcher {
|
||||
log: List<string>;
|
||||
loggedValues: List<any>;
|
||||
onAllChangesDoneCalled: boolean = false;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
@ -984,6 +991,7 @@ class TestDispatcher extends ChangeDispatcher {
|
||||
clear() {
|
||||
this.log = ListWrapper.create();
|
||||
this.loggedValues = ListWrapper.create();
|
||||
this.onAllChangesDoneCalled = true;
|
||||
}
|
||||
|
||||
notifyOnBinding(binding, value) {
|
||||
@ -991,6 +999,8 @@ class TestDispatcher extends ChangeDispatcher {
|
||||
ListWrapper.push(this.loggedValues, value);
|
||||
}
|
||||
|
||||
notifyOnAllChangesDone() { this.onAllChangesDoneCalled = true; }
|
||||
|
||||
_asString(value) { return (isBlank(value) ? 'null' : value.toString()); }
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user