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.
Comments
Post a Comment