I am trying to pass an object from node to a client as shown below
render: function(req,res){ res.render('auth',{ userData : req.session.user }); }
In my auth.jade file below code
script. var data = !{JSON.stringify(userData)} console.log(data) window.top.location='/profile'
So, I redirect the application to the new route that I defined in routeProvider using angularjs
app.config(['$routeProvider','$locationProvider', function($routeProvider,$locationProvider) { $routeProvider. when('/profile', { templateUrl: 'templates/profile.html', controller: 'ProfileCtrl' })
So, is there any way I can access the data object in the controller for this route?
Mozak source share