Hello,
I am a new user on the Ionic community. At the moment, I am creating a little demo application with Ionic2 and today I have found a problem which I don´t know how to resolve. I neet to understand the structure of modal components.
https://github.com/driftyco/ionic/blob/2.0/src/components/modal/modal.ts
If you access to modal.ts you can see that constructor receives objects and appends into data object the componentType and ModalOptions.
constructor(componentType: any, data: any = {}, opts: ModalOptions = {}) {
data.componentType = componentType;
opts.showBackdrop = isPresent(opts.showBackdrop) ? !!opts.showBackdrop : true;
opts.enableBackdropDismiss = isPresent(opts.enableBackdropDismiss) ? !!opts.enableBackdropDismiss : true;
data.opts = opts;
super(ModalCmp, data);
this.isOverlay = true;
this.usePortal = true;
}
As a result I understand that data object is corrupted because it adds two new properties that actually it doesn´t need. For example, if I would want to persist the object I needed to clone the object and delete the extra properties or to delete into data object (params ) the extra properties.
Is this the usually work or is an issue?
Thanks and best regards