Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions www/ftui/components/element.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ export class FtuiElement extends HTMLElement {
this.createShadowRoot(this.template());
}

if (window.ftuiApp) {
ftuiApp.attachBinding(this);
}
// solution adapted from the very useful thread https://stackoverflow.com/questions/7307983/while-variable-is-not-defined-wait
(async () => {
while (typeof window.ftuiApp === 'undefined') await new Promise(resolve => setTimeout(resolve, 2000));
if (typeof window.ftuiApp === 'object')
window.ftuiApp.attachBinding(this);
})();
}

createShadowRoot(content) {
Expand Down