Issue
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?
Solution
You can add it to the global object of the client-side which is window object.
window.publicApi = new MyApi();
Answered By - Mina
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.