angular.module('sample').factory('Service',
function( $rootScope, $http, $location )
{
return {
loadInfo: function()
{
var _url = 'url';
$http.get( _url )
.success( function( data )
{
console.log(data);
})
.error( function( response )
{
error( response );
});
},
});
I cannot call any other services without getting this result , but as it is asynchronous in weak networks it is getting time to load this results and end up with errors . How can i make this call to synchronous. Idea is other all services should wait until it loaded. In jquery ajax we can set a true or false very easily.But i am not able to do it in angular ,I refereed some other answers also but nothing seems to working .
Please suggest