AngularJS - 如何创建具有特定格式的表格? [英] AngularJS - How create a form with specific format?
本文介绍了AngularJS - 如何创建具有特定格式的表格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在AngularJS的新手,我的工作Activiti的。
I'm newbie in AngularJS and I'm working on ACTIVITI.
我需要在一个特定的格式创建表单。每个响应必须是形式:
I need to create a form in a specific format. Every response must be in the form of:
{
"taskId" : "5",
"properties" : [
{
"id" : "room",
"value" : "normal"
}
]
}
用户输入一些文本的形式,和属性值必须等于用户输入
The user input some text in the form, and the attribute "value" need to be equal to the user input.
如何AngularJS达到这个?
How to reach this in AngularJS?
推荐答案
在您输入绑定的NG-模式指令你的价值:
you bind your input with the ng-model directive to your value:
控制器:
$scope.toto = {
"taskId" : "5",
"properties" : [
{
"id" : "room",
"value" : "normal"
}
]
}
html的:
<input ng-model="toto.properties[0].value">
这篇关于AngularJS - 如何创建具有特定格式的表格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文