Skip to content

Commit 51b658d

Browse files
author
Matt Mazzola
committed
Remove use of <any> cast in Utiljs
1 parent 31eab4b commit 51b658d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/util.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default class Utils {
22
static raiseCustomEvent(element: HTMLElement, eventName: string, eventData: any) {
33
let customEvent;
4-
if (typeof (<any>window).CustomEvent === 'function') {
4+
if (typeof CustomEvent === 'function') {
55
customEvent = new CustomEvent(eventName, {
66
detail: eventData,
77
bubbles: true,
@@ -17,6 +17,8 @@ export default class Utils {
1717
return;
1818
}
1919

20+
// TODO: Remove this? Should be better way to handle events than using eval?
21+
// What is use case? <div powerbi-type="report" onload="alert('loaded');"></div>
2022
const inlineEventAttr = 'on' + eventName.replace('-', '');
2123
const inlineScript = element.getAttribute(inlineEventAttr);
2224
if (inlineScript) {

0 commit comments

Comments
 (0)