Hi,
I'm trying to use Dropbox Javascript SDK (version 2) in my angular 1.4 Application.
The installation of the package was OK but when I execute the function 'viewFile' I get an error ReferenceError: Dropbox is not defined in the 2nd line: var dbx = new Dropbox({ accessToken: ACCESS_TOKEN });
You can see the function:
function viewFile() {
var SHARED_LINK = "/" + vm.selectedDoc.url;
var dbx = new Dropbox({ accessToken: ACCESS_TOKEN });
dbx.sharingGetSharedLinkFile({url: SHARED_LINK})
.then(function(data) {
var downloadUrl = URL.createObjectURL(data.fileBlob);
var downloadButton = document.createElement('a');
downloadButton.setAttribute('href', downloadUrl);
downloadButton.setAttribute('download', data.name);
downloadButton.setAttribute('class', 'button');
downloadButton.innerText = 'Download: ' + data.name;
document.getElementById('results').appendChild(downloadButton);
})
.catch(function(error) {
console.error(error);
});
return false;
}Keep in mind that I don´t use TypeScript in the App
How Can I solve this error?
Thanks in advance.