admin管理员组文章数量:1558092
Error: ng:areq
Bad Argument
Argument 'fn' is not%20a%20function%2C%20got%20undefined
Description
AngularJS often asserts that certain values will be present and truthy using a helper function. If the assertion fails, this error is thrown. To fix this problem, make sure that the value the assertion expects is defined and truthy.
$scope.queryByIdOrMesg=function (){
// var userWantResJosn=angular.toJson($scope.userWantRes,true);
console.log(userWantResJosn);
$http.post(settings.apiProxy + 'api/cboard/voip/getFlowLogs',
{message:$scope.userWantRes}).success(function (response,status,config,headers){
$scope.logs = response;
console.log("status:"+status+" config:"+config+" headers:"+headers);
}).error(function (err) {
console.log(err);
})
我在做post请求时,报ng:areq错误,经过不断地改body,才发现自己少传了一个参数
var flowId = $stateParams.flowId;
即post的body里无页面跳转后传递过来的flowId,使得请求失败,改的话就是将flowId:flowId加入到post body里
版权声明:本文标题:Angularjs 错误遇到的小坑 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1727342767a1109608.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论