Currently, I am working on integrating the online document viewer into my project and stumbled upon a website called .
As I explored the developer APIs at , I discovered that I could access any document by providing its URL. However, I am using Angular 4 with Typescript so I encountered some challenges.
To tackle this issue, I included the JavaScript code in my index.html file:
index.html<script type="text/javascript" src="https://api.rollapp.com/1/js/rollmyfile.js"></script>
Next, I needed to utilize this JS file to pass the URL as follows:
<script type="text/javascript">
var key = "SeCur3AP1K3y";
var rollMyFile = new RollMyFile(key);
</script>
rollMyFile.openFileByUrl("https://www.example.com/documentation/overview.docx");
Subsequently, I attempted to use .openFileByUrl in my .component.ts
file.
I also referenced the path in my .component.ts
like this:
///<reference path="https://api.rollapp.com/1/js/rollmyfile.js"/>
However, I am still encountering an issue where I cannot create an instance of RollMyFile.
The error message states:
[ts] Cannot find name 'RollMyFile'
.
Could you please advise on what might be going wrong in this scenario?