Skip to content

async script and serie #95

@koryp

Description

@koryp

Great module! Thank you!!!

I'm loading my custom angular module along with a few dependencies (specifically, jquery then a jq plugin) and so I'm using the serie config option to make sure jquery is ready for the plugin.

But, it appears the buildElement function always includes the async attribute for scripts and my jq plugin seems to be getting executed before jquery finishes loading.

I was able to fix this locally by changing line 111 from:
el.async = 1;
to:
el.async = (params.serie?0:1);

Alternatively, maybe the async attribute could be conditionally removed using a parameter in the load config...

Is this an appropriate fix or is there another approach using ocLazyLoad to avoid async scripts from executing out of sequence?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions