javascript - AngularJS Calling function in controller after data is loaded in another file -


i have function in app.js connects api using promises. app selected opened depends on user id.

me.boot = function () { me.getuserid().then(me.openappfunction); }; 

also, have function in home.js controller

getobjectsfromapp(); 

this function needs executed after application loaded in other file, have no idea how this. app.js file not service or factory, file called when application loads scripts require.js. thing file select app open in api, why called once.

an event looking for...

you should stay in angular environment, so, should use $rootscope.$broadcast , $rootscope.$on , can used everywhere in application because $rootscope is singletone.

this why use $rootscope.$broadcast in angularjs? you.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -