Dropbox chooser for Angular

296 Views Asked by At

I am trying to implement dropbox chooser within my angular app. but the chooser code is in javascript, I don't know how to implement js in angular as I am new to it. my js code for chooser is here.

   
options = {
    success: function(files) {
        console.log("worked");
        files.forEach(function(file) {
        // add_file_to_list(file);

        });
    },
    cancel: function() {
      //optional

    },
    linkType: "direct", // "preview" or "direct"
    multiselect: true, // true or false
    extensions: ['.csv', '.txt'],
};

var button = Dropbox.createChooseButton(options);
document.getElementById("dropbox-upload-container").appendChild(button);
   
<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="My-key-here"></script>
    
<div id="dropbox-upload-container"></div>

Anything as to how to achieve this kind of functionality in Angular will be helpful.

0

There are 0 best solutions below