ngx-kit 8.3.5 → 8.3.6

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.
package/dialog/README.md CHANGED
@@ -93,6 +93,7 @@ export class EditUserComponent {
93
93
  | `ariaLabel` / `ariaLabelledby` / `ariaDescribedby` | `string` | - | |
94
94
  | `animation` | `'zoom' \| 'fade' \| 'slide-up' \| 'none'` | `'zoom'` | |
95
95
  | `injector` | `Injector` | - | Injector والد برای کامپوننت محتوا |
96
+ `NgxDialogService` محیط تزریق خودش را به Overlay منتقل می‌کند؛ بنابراین providerهای ثبت‌شده در مسیر lazy یا محیطی که سرویس از آن resolve شده، برای محتوای دیالوگ نیز در دسترس هستند و نیازی به پاس‌دادن `ViewContainerRef` از سمت فراخواننده نیست.
96
97
 
97
98
  ### `NgxDialogRef<R>`
98
99
 
@@ -1,7 +1,7 @@
1
1
  import * as i1 from '@angular/common';
2
2
  import { CommonModule, isPlatformBrowser, DOCUMENT } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { EventEmitter, forwardRef, HostListener, ViewChild, Output, Input, ChangeDetectionStrategy, Component, inject, ChangeDetectorRef, InjectionToken, PLATFORM_ID, Inject, Injectable, DestroyRef, signal, computed, ApplicationRef, EnvironmentInjector, createComponent } from '@angular/core';
4
+ import { EventEmitter, forwardRef, HostListener, ViewChild, Output, Input, ChangeDetectionStrategy, Component, inject, ChangeDetectorRef, InjectionToken, PLATFORM_ID, Inject, Injectable, DestroyRef, signal, computed, ApplicationRef, EnvironmentInjector, Injector, createComponent } from '@angular/core';
5
5
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormControl, Validators } from '@angular/forms';
6
6
 
7
7
  function getOffsetPosition(evt, parent) {
@@ -1276,16 +1276,18 @@ class OverlayService {
1276
1276
  let componentRef;
1277
1277
  let attachedToAppRef = false;
1278
1278
  if (viewContainerRef) {
1279
- componentRef = options.injector
1280
- ? viewContainerRef.createComponent(component, { injector: options.injector })
1281
- : viewContainerRef.createComponent(component);
1279
+ componentRef = viewContainerRef.createComponent(component, {
1280
+ injector: options.injector,
1281
+ environmentInjector: options.environmentInjector,
1282
+ });
1282
1283
  }
1283
1284
  else {
1284
1285
  // No host ViewContainerRef available (e.g. a global service opening an
1285
1286
  // overlay outside of any component template) - create and attach the
1286
1287
  // component directly against the application, like a root component.
1288
+ const elementInjector = options.injector ?? Injector.NULL;
1287
1289
  componentRef = createComponent(component, {
1288
- environmentInjector: this.environmentInjector,
1290
+ environmentInjector: options.environmentInjector ?? this.environmentInjector,
1289
1291
  elementInjector: options.injector,
1290
1292
  });
1291
1293
  this.applicationRef.attachView(componentRef.hostView);