Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/385.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 角场验证_Javascript_Html_Angularjs_Intellij Idea - Fatal编程技术网

Javascript 角场验证

Javascript 角场验证,javascript,html,angularjs,intellij-idea,Javascript,Html,Angularjs,Intellij Idea,在我的项目中,我想做一个现场验证。所以我找到了一个如何做的教程。根据教程,我得到了这段代码 var-app=angular.module('RegistrationScreen',[]); app.controller('RegistrationScreenController',函数($scope,$http){ $http({ 方法:“GET”, url:“/lt” }).then(函数成功回调(响应){ $scope.nameList=response.data.registration

在我的项目中,我想做一个现场验证。所以我找到了一个如何做的教程。根据教程,我得到了这段代码

var-app=angular.module('RegistrationScreen',[]);
app.controller('RegistrationScreenController',函数($scope,$http){
$http({
方法:“GET”,
url:“/lt”
}).then(函数成功回调(响应){
$scope.nameList=response.data.registrationNameTags;
$scope.topics=response.data.topicList;
$scope.bankDivisions=response.data.bankDivisionList;
document.title=response.data.registrationNameTags.title;
});
});
var applic=angular.module('app',['ngMessages'])

身体{
填充顶部:60px;
}
text区域{调整大小:无;}
{{nameList.header}}
{{nameList.name}

您的名字太短了

您的名字太长了

您的姓名是必填项


您对模块没有什么混淆。删除
ng app=“applic”
属性,并使单个
RegistrationScreen
模块具有ngMessages相关性:

var app = angular.module('RegistrationScreen', ['ngMessages']);

然后您就不需要
var applic=angular.module('app',['ngMessages'])

没问题,很高兴它能帮上忙。您能解释一下为什么它不能工作吗?因为您的应用程序从未使用过正确显示ng消息所必需的ngMessages模块。查找第一个ng app属性并使用它引导应用程序,因此ng app=“applic”被忽略,因此您没有可用的ngMessages。非常感谢您的解释!