feat(ivy): support checkNoChanges (#22710)

PR Close #22710
This commit is contained in:
Kara Erickson
2018-03-09 20:22:18 -08:00
parent 0bf6fa5b32
commit aa7dba244b
4 changed files with 227 additions and 14 deletions

View File

@ -8,7 +8,7 @@
import {EmbeddedViewRef as viewEngine_EmbeddedViewRef} from '../linker/view_ref';
import {detectChanges, markViewDirty} from './instructions';
import {checkNoChanges, detectChanges, markViewDirty} from './instructions';
import {ComponentTemplate} from './interfaces/definition';
import {LViewNode} from './interfaces/node';
import {LView, LViewFlags} from './interfaces/view';
@ -195,7 +195,13 @@ export class ViewRef<T> implements viewEngine_EmbeddedViewRef<T> {
*/
detectChanges(): void { detectChanges(this.context); }
checkNoChanges(): void { notImplemented(); }
/**
* Checks the change detector and its children, and throws if any changes are detected.
*
* This is used in development mode to verify that running change detection doesn't
* introduce other changes.
*/
checkNoChanges(): void { checkNoChanges(this.context); }
}