使用角度JS将HTML表单数据转换为JSON对象 [英] converting Html Form data to JSON object using angular JS

查看:284
本文介绍了使用角度JS将HTML表单数据转换为JSON对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

产品编号 *</span>-> 必须提供产品ID. 产品版本 *</span>-> 产品版本为必填项.

Product Id *</span> --> Product Id is required. Product Version * </span> --> Product Version is required.

推荐答案

查看文档本身提供的简单表单":

Check out the "Simple form" provided in the documentation itself:

https://docs.angularjs.org/guide/forms

在这里,基本上此表达式{{user | json}}将ng-Model对象用户转换为json字符串. 从他们提供的 plunker 中查看工作示例.我已经编辑了插件,以仅保留与您的查询相关的部分.

Here, basically this expression {{user | json}} converts the ng-Model object user to a json string. Check out the working example from the plunker provided by them. I have edited the plunk to keep only the part relevant to your query.

这篇关于使用角度JS将HTML表单数据转换为JSON对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆