I have this function in app.js which connects to an api using promises. The app that is selected to be opened depends on the user ID.
me.boot = function () {
me.getUserID().then(me.openAppFunction);
};
Also, I have this function in my Home.js controller
getObjectsFromApp();
This function needs to be executed after the application is loaded in the other file, but I have no idea how to do this. This app.js file is not a service or a factory, it is just a file that is called when the application loads all the scripts with require.js. The only thing this file does is select which app to open in the api, so that is why it is only called once.