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...
app.get('/test' function(req, res){
res.render('test', { user: 12345 });
});
In my 'test' view, I link the container to angular with ng-controller, like so...
<div ng-controller='testCtrl'> <!--some markup here--> </div>
And in my angular controllers.js, I declare a function for my view, like so...
function testCtrl($scope) {
/*...some code here...*/
}
How can I access the 'user' variable that I passed in to the view from express, inside my controller function?