开发者社区> 问答> 正文

Angular 7-如何使用模板驱动从对象读取服务端验证?

我正在使用Angular 7 Template Driven Form validations。我已经通过链接访问了:https : //jasonwatmore.com/post/2019/06/15/angular-8-template-driven-forms-validation-example,但是我没有找到任何有效的解决方案来阅读Service Side Validation /错误信息。

在UI控制台上,我从服务端(即Spring Boot Services)获取以下表单上的错误消息

0: code: "Size" field: "studentName" message: "Length of characters should be between 1 to 255" resource: "studentDto" proto: Object 1: code: "NotBlank" field: "studentName" message: "Program Name is mandatory" resource: "studentDto" proto: Object 2: code: "NotBlank" field: "studentDesc" message: "Student Description is mandatory" resource: "studentDto" proto: Object length: 3 现在,在每个字段的HTML表单上,我想阅读这些“消息”并了解详细信息,我该怎么做?

image.png

展开
收起
被纵养的懒猫 2019-09-25 15:17:12 454 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
F2etest — 多浏览器兼容性测试整体解决方案 立即下载
内容驱动游戏分发 立即下载
探究 Node.js 的服务端之路 立即下载