title: Output JSON-LD script, loaded via angularjs $http
body: <p>I'm trying to get and output JSON-LD data on the page via $http as follow:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>angular.element(document).ready(function(){        
          $http({
              url:'/product-init',
              method:'POST',
              data:{product_id:$scope.product_id}
          }).then(function(d){
              $scope.product= d.data;
              $scope.jsonLd={
                "@context":"http://schema.org",
                "@type":"Product"
                // atc.....
              }
              $('#json-ld-content').html(JSON.stringify($scope.jsonLd));
          },function(d){
              alert('product init error');            
          });
      });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt;
  &lt;script type="application/ld+json" id="json-ld-content"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I can see the output in web inspector (on the "Elements" tab), but when I run a [check],<a href="http://linter.structured-data.org/" rel="nofollow">1</a> it shows nothing.</p>
  
  <p>Creating <em>script</em> tag by <em>javascript</em> and then setting html, doesn't help as well.
  Also I've found example of loading JSON-LD via AJAX: <a href="http://freizeitler.de/examples/json-ld/index.php" rel="nofollow">it</a> works fine.</p>
  
  <p>What's the difference between my case and example above? How to fix my code?
  Thanks in advance.</p>