// selector field value on metarecord object
aMetarecord: string;
+ // cross-tab communications example
+ private sbChannel: any;
+ sbChannelText: string;
+
constructor(
private idl: IdlService,
private org: OrgService,
private format: FormatService,
private printer: PrintService
) {
+ // BroadcastChannel is not yet defined in PhantomJS and elsewhere
+ this.sbChannel = (typeof BroadcastChannel === 'undefined') ?
+ {} : new BroadcastChannel('eg.sbChannel');
+ this.sbChannel.onmessage = (e) => this.sbChannelHandler(e);
}
ngOnInit() {
});
}
+ sbChannelHandler = msg => {
+ setTimeout(() => { this.sbChannelText = msg.data.msg; });
+ }
+
+ sendMessage($event) {
+ this.sbChannel.postMessage({msg : $event.target.value});
+ }
+
openEditor() {
this.fmRecordEditor.open({size: 'lg'}).then(
ok => { console.debug(ok); },