1

我正在使用 node.js 和护照进行身份验证,如果用户身份验证失败,我需要向客户端发送“登录失败”消息。我的应用程序也使用 express 中间件。我在客户端使用 angular.js。

目前我正在使用该命令来显示静态 html:

var loginStatus = 'Failed';
res.sendfile('views/login.html'); // What should I add/change here in order to send the loginStatus variable ?

这是我的 angular.js 控制器:

function MainController($scope) {
   $scope.loginStatus = // What should I write here in order to get 'Failed' ?
}

我已经在上面的评论中发布了我的问题。

4

0 回答 0