title: Set a value in angular with jQuery ajax
body: <p><br/>
  I want to create a dynamic page (that's why i'm using <a href="https://angularjs.org/" rel="nofollow">angular.js</a>) according to datas from my localhost database. I'm connecting into my DB using a jQuery ajax call function :</p>
  
  <pre><code>var ajaxCall = function(request,datas,async,onSuccess){
      $.ajax({
          async: async,
          url: 'data.php',
          type: "POST",
          data: {
              request: request,
              datas: datas
          },
          dataType:"json",
          success:function(returns){
              if(onSuccess != null)
                  onSuccess(returns);
          }
      });
  };
  </code></pre>
  
  <p><br/> This is my angular file, including the ajaxCall to get my values :</p>
  
  <pre><code>(function(){
      var app = angular.module('user', [ ]);
  
      app.controller('MemberController', function() {
           var user= this;
           user.members= [];
  
           ajaxCall("getMember",null,false,function(result){
               for(var number in result)
                   user.members.push(result[number]);
           });
  
           setTimeout(function(){
               console.log(user.members)
           }, 2500);
       });
  })();
  </code></pre>
  
  <p><br/>From the ajax call, I receive a JSON (valid on <a href="http://jsonlint.com/" rel="nofollow">JSONLint</a>) but in my angular code, when I <code>console.log(user.members)</code> (even with a TimeOut of several seconds), the value of the array is still <code>[]</code> and I can't use it on my html page.</p>
  
  <p>Do you have any idea why ? Or how can I change my code to make it work ? Thank you !</p>