@smartsoft001/angular 2.94.0 → 2.95.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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Injectable, ComponentFactoryResolver, InjectionToken, ApplicationRef, NgModuleRef, PLATFORM_ID, Inject, signal, NgModule, ViewContainerRef, Directive, input, output, HostListener, Pipe, Type, model, Component, ChangeDetectorRef, ElementRef, Injector, viewChild, effect, computed, ChangeDetectionStrategy, ViewEncapsulation, viewChildren, forwardRef, Renderer2, NgZone, untracked } from '@angular/core';
2
+ import { inject, Injectable, ComponentFactoryResolver, InjectionToken, ApplicationRef, NgModuleRef, PLATFORM_ID, Inject, signal, NgModule, ViewContainerRef, Directive, input, output, HostListener, Pipe, Type, model, Component, ChangeDetectorRef, ElementRef, Injector, viewChild, effect, computed, runInInjectionContext, ChangeDetectionStrategy, ViewEncapsulation, viewChildren, forwardRef, Renderer2, NgZone, untracked } from '@angular/core';
3
3
  import { Title, DomSanitizer } from '@angular/platform-browser';
4
4
  import { Router, NavigationEnd, NavigationStart, NavigationCancel, NavigationError, RouterModule } from '@angular/router';
5
5
  import * as i1 from '@ngx-translate/core';
@@ -1545,8 +1545,10 @@ function CreateDynamicComponent(type) {
1545
1545
  cd = inject(ChangeDetectorRef);
1546
1546
  moduleRef = inject((NgModuleRef));
1547
1547
  componentFactoryResolver = inject(ComponentFactoryResolver);
1548
+ injector = inject(Injector);
1548
1549
  _renderCustom = false;
1549
1550
  _findDynamicContent = false;
1551
+ _dynamicContents$ = null;
1550
1552
  baseInstance = null;
1551
1553
  baseComponentRef = null;
1552
1554
  dynamicType = type;
@@ -1561,9 +1563,10 @@ function CreateDynamicComponent(type) {
1561
1563
  if (this._findDynamicContent || !this.dynamicContents())
1562
1564
  return;
1563
1565
  this._findDynamicContent = true;
1564
- toObservable(this.dynamicContents)
1565
- .pipe(this.takeUntilDestroy)
1566
- .subscribe(() => {
1566
+ if (!this._dynamicContents$) {
1567
+ this._dynamicContents$ = runInInjectionContext(this.injector, () => toObservable(this.dynamicContents));
1568
+ }
1569
+ this._dynamicContents$.pipe(this.takeUntilDestroy).subscribe(() => {
1567
1570
  this.init();
1568
1571
  });
1569
1572
  this.init();