I am new to ionic1 framework and working on sidemenu ionic app.    I am using cordova local notification its working fine but  i need to send notification on specific condition within $ionicPlatform.ready.   For condition, i am getting data from webservice using  $http but unfortunately i am unable to retrieve data out of the $http.
 $ionicPlatform.ready(function() {
 var conditionvariable="true";
 $http.get("http://www.example.com/abc.php").then(function(response) 
   {
       var test = response.data[0];
        if(test.result=='test')
                {
                     conditionvariable="false";
                 }   
    });
  alert(conditionvariable);
 })     
I am unable to get data out of the function $http.get function.   If i am trying to alert it out of the function it alerts undefined 
Please help how to get data.
 
     
    