Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An extended and more robust injectScript #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nolaneo
Copy link

@nolaneo nolaneo commented Jan 25, 2017

New

  • Allows for the promise to reject if the script doesn't load.

Changes

  • Remove script from the DOM after load or failure.
  • Remove event listeners.
  • Updated to Ember 2.11

@nolaneo
Copy link
Author

nolaneo commented Jan 25, 2017

@rlivsey we wrote a similar lib to inject-script @intercom. You might check out the additions and see if they're a good fit for bringing into your addon 🙂

@rlivsey
Copy link
Member

rlivsey commented Jan 25, 2017

@nolaneo changes look fantastic, thanks! Addon version/description etc got lost in package.json after ember-cli upgrade, if you could bring those back then I'll get it merged and a new version released asap.

@nolaneo
Copy link
Author

nolaneo commented Jan 25, 2017

Whoops, my bad. Added those back 👌

@knownasilya
Copy link

Ping

removeListenersAndElement(script);
reject(error);
});
script.asnyc = true;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a typo here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants