I have an Angular application and need to create an API for a third party javascript that will be added dynamically.
public class MyApi{
public callSomeFunction():void{...}
public getSomeValue():any {...}
}
var publicApi = new MyApi();
How do I get the publicApi
object into javascripts global scope?
You can add it to the global
object of the client-side
which is window
object.
window.publicApi = new MyApi();