@ionic/angular 7.6.7-dev.11706197709.160c1815 → 7.6.7-dev.11706198728.127edf24

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.
@@ -815,9 +815,32 @@ const attachView = (zone, environmentInjector, injector, applicationRef, elRefMa
815
815
  if (elementReferenceKey && instance[elementReferenceKey] !== undefined) {
816
816
  console.error(`[Ionic Error]: ${elementReferenceKey} is a reserved property when using ${container.tagName.toLowerCase()}. Rename or remove the "${elementReferenceKey}" property from ${component.name}.`);
817
817
  }
818
+ /**
819
+ * Angular 14.1 added support for setInput
820
+ * so we need to fall back to Object.assign
821
+ * for Angular 14.0.
822
+ */
818
823
  if (componentRef.setInput !== undefined) {
819
- for (const key in params) {
820
- componentRef.setInput(key, params[key]);
824
+ const { modal, popover, otherParams } = params;
825
+ /**
826
+ * Any key/value pairs set in componentProps
827
+ * must be set as inputs on the component instance.
828
+ */
829
+ for (const key in otherParams) {
830
+ componentRef.setInput(key, otherParams[key]);
831
+ }
832
+ /**
833
+ * Using setInput will cause an error when
834
+ * setting modal/popover on a component that
835
+ * does not define them as an input. For backwards
836
+ * compatibility purposes we fall back to using
837
+ * Object.assign for these properties.
838
+ */
839
+ if (modal !== undefined) {
840
+ Object.assign(instance, { modal });
841
+ }
842
+ if (popover !== undefined) {
843
+ Object.assign(instance, { popover });
821
844
  }
822
845
  }
823
846
  else {