title: Angularjs: Databinding not working
body: <p>Binding a service/factory variable within a controller works perfectly unless the factory variable is initiated through $http. Can anyone explain why?</p>
  
  <p>NOTE: Since controller.someVariable = factory.someVariable doesn't work. Currently I am referencing the factory variable directly for manipulation as 
  factory.someVariable</p>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>app.controller('SecondCtrl',function($scope,testFactory){
    $scope.obj = testFactory.obj;
    $scope.factory = testFactory;
    $scope.jsonData = testFactory.jsonData;   //Not Binding
  
    //Accessing $scope.factory.jsonData works while $scope.jsonData doesn't
  });
  </code></pre>
  
  <p><strong>Factory:</strong> </p>
  
  <pre><code>app.factory('testFactory', ['$rootScope','$http',function ($rootScope,$http) {
  
      var factory = {};
  
      factory.obj = { 'name':'Jhon Doe'};
  
      factory.jsonData;
  
      factory.fromjson = function() {
        $http.get("data.json")
          .success(function(data){
             factory.jsonData  = data.result;
          })
  
      }
  
      factory.fromjson();
  
      return factory;
  
  }]);
  </code></pre>
  
  <p><strong>Plunker:</strong> <a href="http://plnkr.co/edit/wdmR5sGfED0jEyOtcsFz?p=preview" rel="nofollow">http://plnkr.co/edit/wdmR5sGfED0jEyOtcsFz?p=preview</a></p>