angular-three 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2513,6 +2513,17 @@ function injectBeforeRender(cb, priority = 0) {
2513
2513
  }
2514
2514
  }
2515
2515
 
2516
+ function safeDetectChanges(cdr) {
2517
+ try {
2518
+ if (cdr['context']) {
2519
+ cdr.detectChanges();
2520
+ }
2521
+ }
2522
+ catch (e) {
2523
+ cdr.markForCheck();
2524
+ }
2525
+ }
2526
+
2516
2527
  function injectNgtRef(initialValue = null) {
2517
2528
  const ref = is.ref(initialValue) ? initialValue : new ElementRef(initialValue);
2518
2529
  let lastValue = ref.nativeElement;
@@ -2565,9 +2576,7 @@ function injectNgtRef(initialValue = null) {
2565
2576
  // during creation phase, 'context' on ViewRef will be null
2566
2577
  // we check the "context" to avoid running detectChanges during this phase.
2567
2578
  // because there's nothing to check
2568
- if (cd['context']) {
2569
- cd.detectChanges();
2570
- }
2579
+ safeDetectChanges(cd);
2571
2580
  }
2572
2581
  }
2573
2582
  },
@@ -2875,5 +2884,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.3", ngImpor
2875
2884
  * Generated bundle index. Do not edit.
2876
2885
  */
2877
2886
 
2878
- export { NGT_CATALOGUE, NgtArgs, NgtCanvas, NgtPortal, NgtPortalBeforeRender, NgtPortalContent, NgtPush, NgtRepeat, NgtRxStore, NgtStore, addAfterEffect, addEffect, addTail, applyProps, checkNeedsUpdate, checkUpdate, createAttachFunction, createLoop, extend, flushGlobalEffects, getLocalState, injectBeforeRender, injectNgtDestroy, injectNgtLoader, injectNgtRef, invalidateInstance, is, makeDefaultCamera, makeDefaultRenderer, makeDpr, makeId, makeObjectGraph, prepare, rootStateMap, startWithUndefined, tapEffect, updateCamera };
2887
+ export { NGT_CATALOGUE, NgtArgs, NgtCanvas, NgtPortal, NgtPortalBeforeRender, NgtPortalContent, NgtPush, NgtRepeat, NgtRxStore, NgtStore, addAfterEffect, addEffect, addTail, applyProps, checkNeedsUpdate, checkUpdate, createAttachFunction, createLoop, extend, flushGlobalEffects, getLocalState, injectBeforeRender, injectNgtDestroy, injectNgtLoader, injectNgtRef, invalidateInstance, is, makeDefaultCamera, makeDefaultRenderer, makeDpr, makeId, makeObjectGraph, prepare, rootStateMap, safeDetectChanges, startWithUndefined, tapEffect, updateCamera };
2879
2888
  //# sourceMappingURL=angular-three.mjs.map