如何从角度控制器

时间:2017-04-03 04:03:47

标签: angularjs node.js express

我有一个角度控制器,

$http.get("/videos?sessionId="+helpers.isAuthenticated.then(function(res){
    console.log(res);
});

上面的函数现在是未授权的,因为在api路由中需要调用函数isAuthenticated

app.get('/videos', helpers.isAuthenticated,videos.get);

但是当我尝试时会出现以下错误,

ReferenceError: helpers is not defined

提前致谢

1 个答案:

答案 0 :(得分:0)

首先,您必须验证id会话从其他函数获取它或将值$ scope保存在index.html上的隐藏输入文本中,以便在后端设置此值并将参数添加到URL

$ scope.sessionId

祝你好运

相关问题