survey-angular-ui 2.5.28 → 2.5.30

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.
@@ -723,17 +723,22 @@
723
723
  var componentType = this.creatorHash[elementType];
724
724
  if (!componentType)
725
725
  return null;
726
- return containerRef.createComponent(resolver.resolveComponentFactory(componentType));
726
+ try {
727
+ return containerRef.createComponent(componentType);
728
+ }
729
+ catch (e) {
730
+ return containerRef.createComponent(resolver.resolveComponentFactory(componentType));
731
+ }
727
732
  };
728
733
  return AngularComponentFactory;
729
734
  }());
730
735
  AngularComponentFactory.Instance = new AngularComponentFactory();
731
736
 
732
737
  var DynamicComponentDirective = /** @class */ (function () {
733
- function DynamicComponentDirective(containerRef, templateRef, resolver) {
738
+ function DynamicComponentDirective(containerRef, templateRef, injector) {
734
739
  this.containerRef = containerRef;
735
740
  this.templateRef = templateRef;
736
- this.resolver = resolver;
741
+ this.injector = injector;
737
742
  }
738
743
  DynamicComponentDirective.prototype.ngOnChanges = function (changes) {
739
744
  var _a;
@@ -748,11 +753,10 @@
748
753
  };
749
754
  DynamicComponentDirective.prototype.createComponent = function () {
750
755
  this.containerRef.clear();
751
- if (AngularComponentFactory.Instance.isComponentRegistered(this.component.name)) {
752
- this.componentInstance = AngularComponentFactory.Instance.create(this.containerRef, this.component.name, this.resolver).instance;
753
- }
754
- else if (this.component.default) {
755
- this.componentInstance = AngularComponentFactory.Instance.create(this.containerRef, this.component.default, this.resolver).instance;
756
+ var componentName = AngularComponentFactory.Instance.isComponentRegistered(this.component.name) ? this.component.name : this.component.default;
757
+ if (componentName) {
758
+ var resolver = this.injector.get(i0.NgModuleRef).componentFactoryResolver;
759
+ this.componentInstance = AngularComponentFactory.Instance.create(this.containerRef, componentName, resolver).instance;
756
760
  }
757
761
  if (!this.componentInstance) {
758
762
  throw new Error("Can't create component with name: " + this.component.name + " and default: " + this.component.default);
@@ -771,14 +775,14 @@
771
775
  };
772
776
  return DynamicComponentDirective;
773
777
  }());
774
- DynamicComponentDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: DynamicComponentDirective, deps: [{ token: i0__namespace.ViewContainerRef }, { token: i0__namespace.TemplateRef }, { token: i0__namespace.ComponentFactoryResolver }], target: i0__namespace.ɵɵFactoryTarget.Directive });
778
+ DynamicComponentDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: DynamicComponentDirective, deps: [{ token: i0__namespace.ViewContainerRef }, { token: i0__namespace.TemplateRef }, { token: i0__namespace.Injector }], target: i0__namespace.ɵɵFactoryTarget.Directive });
775
779
  DynamicComponentDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: DynamicComponentDirective, selector: "[component]", inputs: { component: "component" }, usesOnChanges: true, ngImport: i0__namespace });
776
780
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: DynamicComponentDirective, decorators: [{
777
781
  type: i0.Directive,
778
782
  args: [{
779
783
  selector: "[component]"
780
784
  }]
781
- }], ctorParameters: function () { return [{ type: i0__namespace.ViewContainerRef }, { type: i0__namespace.TemplateRef }, { type: i0__namespace.ComponentFactoryResolver }]; }, propDecorators: { component: [{
785
+ }], ctorParameters: function () { return [{ type: i0__namespace.ViewContainerRef }, { type: i0__namespace.TemplateRef }, { type: i0__namespace.Injector }]; }, propDecorators: { component: [{
782
786
  type: i0.Input
783
787
  }] } });
784
788
 
@@ -989,10 +993,9 @@
989
993
  }] } });
990
994
 
991
995
  var PopupService = /** @class */ (function () {
992
- function PopupService(injector, applicationRef, componentFactoryResolver) {
996
+ function PopupService(injector, applicationRef) {
993
997
  this.injector = injector;
994
998
  this.applicationRef = applicationRef;
995
- this.componentFactoryResolver = componentFactoryResolver;
996
999
  }
997
1000
  PopupService.prototype.createComponent = function (popupViewModel) {
998
1001
  var portalHost;
@@ -1002,7 +1005,8 @@
1002
1005
  portalHost = new portal.DomPortalOutlet(popupViewModel.container, this.applicationRef, this.injector);
1003
1006
  }
1004
1007
  else {
1005
- portalHost = new portal.DomPortalOutlet(popupViewModel.container, this.componentFactoryResolver, this.applicationRef, this.injector);
1008
+ var resolver = this.injector.get(i0.NgModuleRef).componentFactoryResolver;
1009
+ portalHost = new portal.DomPortalOutlet(popupViewModel.container, resolver, this.applicationRef, this.injector);
1006
1010
  }
1007
1011
  var portal$1 = new portal.ComponentPortal(PopupBaseContainerComponent);
1008
1012
  var componentRef = portalHost.attach(portal$1);
@@ -1013,11 +1017,11 @@
1013
1017
  };
1014
1018
  return PopupService;
1015
1019
  }());
1016
- PopupService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PopupService, deps: [{ token: i0__namespace.Injector }, { token: i0__namespace.ApplicationRef }, { token: i0__namespace.ComponentFactoryResolver }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1020
+ PopupService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PopupService, deps: [{ token: i0__namespace.Injector }, { token: i0__namespace.ApplicationRef }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1017
1021
  PopupService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PopupService });
1018
1022
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PopupService, decorators: [{
1019
1023
  type: i0.Injectable
1020
- }], ctorParameters: function () { return [{ type: i0__namespace.Injector }, { type: i0__namespace.ApplicationRef }, { type: i0__namespace.ComponentFactoryResolver }]; } });
1024
+ }], ctorParameters: function () { return [{ type: i0__namespace.Injector }, { type: i0__namespace.ApplicationRef }]; } });
1021
1025
 
1022
1026
  var ModalComponent = /** @class */ (function () {
1023
1027
  function ModalComponent(popupService) {