title: Access global variable in angular
body: <p>I am using node express and angular. In my express app.js, I declare a route and pass a variable to the rendered page, like so...</p>
  
  <pre><code>app.get('/test' function(req, res){
    res.render('test', { user: 12345 });
  });
  </code></pre>
  
  <p>In my 'test' view, I link the container to angular with ng-controller, like so...</p>
  
  <pre><code>&lt;div ng-controller='testCtrl'&gt; &lt;!--some markup here--&gt; &lt;/div&gt;
  </code></pre>
  
  <p>And in my angular controllers.js, I declare a function for my view, like so...</p>
  
  <pre><code>function testCtrl($scope) {
      /*...some code here...*/
  }
  </code></pre>
  
  <p>How can I access the 'user' variable that I passed in to the view from express, inside my controller function?</p>