Custom JS loading concurrency

Issue #89 resolved
Nicolas Scheys created an issue

In my widget, I want to display a date with "pretty.js".

With this intent, I have added "pretty.js" to the customJS property.

However, the function prettyDate is undefined in my widget.

It seems that the function is loaded after the onData is executed.

I've found a workaround by delaying the call with a setTimeout.

Could it be done at the framework level?

PS: Thanks for this great project.

Comments (3)

  1. Iván Loire

    Hi @nscheys ,

    Would switching the order of those two lines fix that issue for you? (atlasboard/templates/dashboard.ejs)

        <script src="javascripts/application.js"></script>
        <script src="<%=dashboardName%>/js"></script>
    

    We are brainstorming managing frontend dependencies with bower at a package level for the next major version.

  2. Log in to comment