* 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.
()
| 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) { |
no test coverage detected