Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/387.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Angular JS代码中的函数生日在SharePoint 2013中不起作用_Javascript_Angularjs_Sharepoint 2013_Web Parts - Fatal编程技术网

Javascript Angular JS代码中的函数生日在SharePoint 2013中不起作用

Javascript Angular JS代码中的函数生日在SharePoint 2013中不起作用,javascript,angularjs,sharepoint-2013,web-parts,Javascript,Angularjs,Sharepoint 2013,Web Parts,当我用函数add()单击按钮时,出现了一个错误! 此函数必须呈现一个列表并提取 生日就在今天,但发生的事情只是重新阅读了这一页。可以 谁来帮帮我 var app=angular.module('app.demo',[]); app.controller('LancerEvalController',函数($scope,$http){ $scope.obj={ 出生日期:“, 名称:“, 邮件:“ }; $scope.add=函数(){ $http({ 方法:“获取”, url:“http:/

当我用函数
add()
单击按钮时,出现了一个错误! 此函数必须呈现一个列表并提取 生日就在今天,但发生的事情只是重新阅读了这一页。可以 谁来帮帮我


var app=angular.module('app.demo',[]);
app.controller('LancerEvalController',函数($scope,$http){
$scope.obj={
出生日期:“,
名称:“,
邮件:“
};
$scope.add=函数(){
$http({
方法:“获取”,
url:“http://...../_api/web/lists/getByTitle('Anniversair2')/items?$select=dateBirth、nom、mail&$top=1000“,
标题:{
“接受”:“application/json;odata=verbose”
}
}
).success(函数(数据、状态、标题、配置){
$scope.obj=data.d.结果;
var d=新日期();
var n=d.getDay();
console.log(“n=”,n);
变量y=d.getFullYear();
console.log(“y=”,y);
var m=d.getMonth()+1;
console.log(“m=,m);
对于(变量i=0;i<$scope.obj.length;i++){
var b=新日期($scope.obj[i].dateBirth);
var nom=$scope.obj[i].nom;
var mail=$scope.obj[i].mail;
var nb=b.getDay();
var dateBirth=$scope.obj[i].dateBirth;
//var mb=b.getMonth()+1;
如果(d.getDate()==b.getDate()&&d.getMonth()+1==b.getMonth()+1){
console.log(“nb=”,nb);
console.log(“b=”,b);
var n=d.getDay();
console.log(“n=”,n);
myFunction(n、nom、mail、dateBirth);
}else if(d.getDate()+1==b.getDate()&d.getMonth()+1==b.getMonth()+1){
console.log(“nb=”,nb);
console.log(“b=”,b);
var n=d.getDay();
var n=n+1;
console.log(“n+1=”,n);
myFunction(n、nom、mail、dateBirth);
}
函数myFunction(n、nom、mail、dateBirth){
//警报($scope.month.title);
//console.log($scope.month);
$scope.dateBirthD=日期出生;
$scope.counter=n;
$scope.email=邮件;
$scope.loginNName=nom;
var clientContext=new SP.clientContext.get_current();
var web=clientContext.get_web();
var list=web.get_list().getByTitle(“生日”);
//创建ListItemInformation对象
var listItemInfo=新SP.ListItemCreationInformation();
//将项目添加到列表中
var listItem=list.addItem(listItemInfo);
//为字段赋值
listItem.set_项('DisplayName',$scope.LoginName);
listItem.set_项('Email',$scope.Email);
listItem.set_项('BirthDayOfYear',$scope.counter);
listItem.set_项('dateBirth',$scope.dateBirthD);
update();
clientContext.executeQueryAsync(
createDelegate函数(这个,onQuerySucceed),
Function.createDelegate(此,onQueryFailed)
);
};
onQuerySucceeded=函数(){
//警报(“votre message aétéemissionéavec success”);
console.log(“votre message aétéemissionéavec success”);
}
onQueryFailed=函数(发送方,参数){
//警报('请求失败。'+args.get_message()+'\n'+args.get_stackTrace());
console.log('请求失败。'+args.get_message()+'\n'+args.get_stackTrace());
}
}
}).error(函数(数据、状态、标题、配置){});
}
});

点击我!

您可能会想制作一份报告,以提高获得答案的机会。