Skip to content

Instantly share code, notes, and snippets.

@hetdev
Created August 27, 2019 16:41
Show Gist options
  • Save hetdev/375731e6f789a4f54c9f0b1fc69409fc to your computer and use it in GitHub Desktop.
Save hetdev/375731e6f789a4f54c9f0b1fc69409fc to your computer and use it in GitHub Desktop.
sendCustomEvent() {
const data = {
name: 'DataSentThoughtCustomEvent'
};
const event = new CustomEvent('phoenix-wc-wiki-ngx-ce-data-sent-test', { detail: data });
window.dispatchEvent(event);
}
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'phoenix-wc-wiki-ngx';
sendCustomEvent() {
const data = {
name: 'DataSentThoughtCustomEvent'
};
const event = new CustomEvent('phoenix-wc-wiki-ngx-ce-data-sent-test', { detail: data });
window.dispatchEvent(event);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment