-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
I think the scope of this fix should just be to supply a useful error message such as "Non-serializable modal context not supported".
If I attempt to pass a function to the modal context, I get the error: DOMException: Failed to execute 'postMessage' on 'Window': function () { } could not be cloned.
Example code:
import { Component, Injectable } from '@angular/core';
import { SkyAppConfig } from '@skyux/config';
import { SkyAddinModalService } from '@blackbaud-internal/skyux-lib-addin-host';
import { AddinCloseModalArgs } from '@blackbaud-internal/sky-addin-host';
import { Router } from '@angular/router';
@Component({
selector: 'example',
templateUrl: './example.component.html'
})
@Injectable()
export class ExampleComponent {
constructor(
private skyAppConfig: SkyAppConfig,
private skyAddinModalService: SkyAddinModalService,
private router: Router
) { }
public openExampleModal() {
this.skyAddinModalService.openModal({
id: 'Example Modal',
url:
`https://renxt.blackbaud.com/addins/addconstituent?envid=${this.skyAppConfig.runtime.params.get('envid')}&internalmodal=true`,
modalMetadata: {
context: {
duplicateSelectedHandler: function () { }
}
}
})
.then((args: AddinCloseModalArgs) => {
console.log(JSON.stringify(args));
});
}
}
Metadata
Metadata
Assignees
Labels
No labels