I follow the guide on setting authentication using nodejs and passport. ( http://scotch.io/tutorials/javascript/easy-node-authentication-setup-and-local )
The tutorial presents rendering templates with ejs and transferring flash data.
Instead, I would like to use angularjs. I'm having trouble getting flash data. I know how to use templates and send variables, but what does angular replace "req.flash (" signupMessage ") in the code below?
This is the code that the tutorial shows:
app.get('/signup', function(req, res) { // render the page and pass in any flash data if it exists res.render('signup.ejs', { message: req.flash('signupMessage') }); });
This is the code in which I configured my route
// public/js/appRoutes.js angular.module('appRoutes', []).config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { $routeProvider // show signup form .when('/signup', { templateUrl: 'views/signup.html', controller: 'SignupController' }); $locationProvider.html5Mode(true); }]);
Here is the controller:
// public/js/controllers/SetupCtrl.js angular.module('SignupCtrl', []).controller('SignupController', function($scope) { $scope.tagline = 'TEST'; });
source share