title: Initialize a json object to a variable
body: <pre><code>(function() {
     var app = angular.module('myApp', ['chartjs-directive']);
  
     app.controller('myController', function($scope,$http){
         var chart_data = {};
  
         $http.get('js/chart_data.json').success(function(data){
            chart_data = data;          
         });  
  
         $scope.myChart = {"data": chart_data, "options": {} };
     });
  
  })(); 
  </code></pre>
  
  <p>If chart_data is directly assigned to key value pairs its working fine...</p>
  
  <p>How to initialize <code>chart_data</code> variable inside <code>$http</code> service. The above syntax is not correct. </p>