MCPcopy
hub / github.com/angular/angular / checkNoChanges

Method checkNoChanges

packages/core/src/render3/view_ref.ts:323–340  ·  view source on GitHub ↗

* 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.

()

Source from the content-addressed store, hash-verified

321 * introduce other changes.
322 */
323 checkNoChanges(): void {
324 // Note: we use `if (ngDevMode) { ... }` instead of an early return.
325 // ESBuild is conservative about removing dead code that follows `return;`
326 // inside a function body, so the block may remain in the bundle.
327 // Using a conditional ensures the dev-only logic is reliably tree-shaken
328 // in production builds.
329 if (ngDevMode) {
330 try {
331 this.exhaustive ??= this._lView[INJECTOR].get(
332 UseExhaustiveCheckNoChanges,
333 USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT,
334 );
335 } catch {
336 this.exhaustive = USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT;
337 }
338 checkNoChangesInternal(this._lView, this.exhaustive);
339 }
340 }
341
342 attachToViewContainerRef() {
343 if (this._appRef) {

Callers 1

ApplicationRefClass · 0.45

Calls 2

checkNoChangesInternalFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected