urish / angular-load

Dynamically load scripts and css stylesheets in your Angular.JS app
MIT License
243 stars 65 forks source link

Additional attributes of created element #29

Closed norkunas closed 7 years ago

norkunas commented 8 years ago
var attrs = {
  id: 'dropboxjs',
  dataset: {
    appKey: 'dropbox_app_key'
  }
};

angularLoad.loadScript('https://www.dropbox.com/static/api/2/dropins.js', attrs).then(function () {
  Dropbox.choose(..);
});

And the created element would contain:

<script src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="dropbox_app_key"></script>

Those attributes are mandatory to load dropbox js api. If you think this is worth I can make a PR.