Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.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
angularJS显示消息的验证_Angularjs_Forms_Validation - Fatal编程技术网

angularJS显示消息的验证

angularJS显示消息的验证,angularjs,forms,validation,Angularjs,Forms,Validation,这是角度代码。 .controller(“mystList”、[“$scope”、“weejoinMessage”、“httpServer”、“$modal”、“ngWeeJoinServer”、“stuServer”、函数($scope、weejoinMessage、httpServer、$modal、server、stuServer){ //第一次进入是加载所有学员数据 $scope.stuinfos=infos.info;//我将数据表单info.info提供给stuinfos。 // $

这是角度代码。
.controller(“mystList”、[“$scope”、“weejoinMessage”、“httpServer”、“$modal”、“ngWeeJoinServer”、“stuServer”、函数($scope、weejoinMessage、httpServer、$modal、server、stuServer){
//第一次进入是加载所有学员数据
$scope.stuinfos=infos.info;//我将数据表单info.info提供给stuinfos。
//
$scope.course='';
$scope.class='';
$scope.name='';
$scope.age='';
$scope.scores='';
$scope.createNew=函数(){
httpServer.httpHandle({
url:stuBag.action.createNew,
数据:{
courseId:$scope.course,
classId:$scope.class,
stune:$scope.name,
年龄:$scope.age,
分数:$scope.scores
},
成功:功能(数据){
weejoinMessage.messageSuccess(“添加成功!");                   
$scope.stuinfos.push({'CourseName':$scope.course,'ClassName':$scope.class,'StuName':$scope.name,'Age':$scope.Age,'Scores':$scope.Scores});
}
});

}
不应该
创建新表单。课程。$invalid
应该
创建新表单。课程。$invalid
(在“createnew”中带有一个“e”)?

我已经在JSFIDLE上使用了您的代码,表单验证工作正常。 我没有像你提到的那样看到所有的错误消息。请看这里的小提琴:

您的HTML代码:


姓名
请输入姓名
至少输入两个字
最多输入五个字
年龄
请输入年龄
最小年龄为0
最大年龄为100

有控制台错误吗?请检查angularjs代码并帮助我找到问题是的。但当我更改此代码时,它将在查看页面上同时显示所有错误消息