I have a unique scenario that I need help with.
In my project, I am using a javascript file with three.js to render some models. To combine my frontend WebGL rendering with a backend library, I used Browsefiy to create a single js file named script.js.
Now, I want to trigger the init function in the script.js file from my controller in controllers.js. However, I am struggling to find a solution as the angularJs controller seems isolated from external code.
After combining the backend library, my rendering code expanded from 400 lines to over 2500 lines, making it difficult to manage in a single controller.
Is there a way to overcome this challenge? I would appreciate any suggestions or ideas!
<head>
<---These are the required angular files--->
<script src="./lib/angular/angular.min.js"></script>
<script src="./lib/angular-route/angular-route.min.js"></script>
<script src="./js/app.js"></script>
<script src="./js/controllers.js"></script>
<script src="./js/services.js"></script>
<--These are the required rendering files-->
<script src="lib/third-party/threejs/three.min.js"></script>
<script src="lib/third-party/threejs/StereoEffect.js"></script>
<script src="lib/third-party/threejs/DeviceOrientationControls.js"></script>
<script src="lib/third-party/threejs/OrbitControls.js"></script>
<script src="./js/script.js"></script>
</head>
Update I have shared my script.js file, which is quite lengthy. Any suggestions on how to access the init function easily would be appreciated. Thanks!