Currently, I am exploring the most efficient method of calling a function from an AngularJS controller externally.
In our setup, data is transmitted from a Python backend to the frontend using JavaScript functions. To feed this data into the Angular controller, I am utilizing the following approach...
function myFunction(var1, var2) {
angular.element($('body')).scope().insideFunction(var1, var2);
}
Although this solution works effectively, I am curious if there are better alternatives available.
Update: I have proceeded with this strategy and successfully implemented 8 "outside scope" functions. The flow of data remains consistent from Python > JS function > Angular function.
If you have any suggestions for improving this process, please do share your insights.