title: How to bind AngularJs variable inside javascript data field?
body: <p>I would like to bind a variable took from a json file inside a javascript data field, but i can't use the {{}} operator because it's processed after.</p>
  
  <pre><code>&lt;div class="milestone"&gt;
    &lt;div class="number" data-animation="true" data-animation-type="number" data-final-number="{{itemSold}}"&gt;&lt;/div&gt;
    &lt;div class="title"&gt;Items Sold&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In this way it gives to me a NaN because he can't see the value of itemSold.</p>
  
  <p>This is how itemSold is retrived</p>
  
  <pre><code>var app = angular.module('app', []);
  app.controller('AppCtrl', ['$scope', '$http', function($scope, $http) 
  {
    $http.get('app/shared/homeStatistics.json').success(function(data){
     $scope.itemSold = data.itemSold;
     $scope.themeAndTemplate = data.themeAndTemplate;
     $scope.members = data.members;
    });
  }]);
  </code></pre>
  
  <p>I think that i have to use something like ng-bing that is processed before, but i dont know how.</p>
  
  <p>Thanks for all suggestions and sorry for my bad english</p>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>The data are correctly retrieved but are processed after the data-final-number so he read a "" at the beginning</p>
  
  <p>my json data</p>
  
  <pre><code>{
  "itemSold":1000
  }
  </code></pre>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>here it how it is processed the data-final-number</p>
  
  <pre><code>var handlePageScrollContentAnimation = function() {
  $('[data-scrollview="true"]').each(function() {
      var myElement = $(this);
  
      var elementWatcher = scrollMonitor.create( myElement, 60 );
  
      elementWatcher.enterViewport(function() {
          $(myElement).find('[data-animation=true]').each(function() {
              var targetAnimation = $(this).attr('data-animation-type');
              var targetElement = $(this);
              if (!$(targetElement).hasClass('contentAnimated')) {
                  if (targetAnimation == 'number') {
                      var finalNumber = parseInt($(targetElement).attr('data-final-number'));
                      $({animateNumber: 0}).animate({animateNumber: finalNumber}, {
                          duration: 1000,
                          easing:'swing',
                          step: function() {
                              var displayNumber = handleAddCommasToNumber(Math.ceil(this.animateNumber));
                              $(targetElement).text(displayNumber).addClass('contentAnimated');
                          }
                      });
                  } else {
                      $(this).addClass(targetAnimation + ' contentAnimated');
                  }
              }
          });
      });
  });
  };
  </code></pre>