title: Passing data from server to angular
body: <p>Sorry, I'm a newbie at this</p>
  
  <p>Let's say i have the following in node express</p>
  
  <pre><code>router.get('/:name', function(req, res, next) {
        res.render("test", {test:req.test});
  });
  </code></pre>
  
  <p>how to do I get the angular to pick up the test variable?</p>
  
  <p>i tried doing in the html page</p>
  
  <pre><code>    &lt;div ng-controller='UserCtrl'&gt;{{ data }}&lt;/div&gt;
      &lt;script&gt;
           var test=!{JSON.stringify(test)};
      &lt;/script&gt;
  </code></pre>
  
  <p>then on the angular page</p>
  
  <pre><code>productApp.controller('UserCtrl',function UserCtrl($scope){
      $scope.data=test;
  });
  </code></pre>
  
  <p>the req.test looks like this</p>
  
  <pre><code> [
     { 
        name: 'test' 
     }
   ]
  </code></pre>
  
  <p>the 'data' shows empty everytime.</p>
  
  <p>thank you for your help</p>