【发布时间】:2015-12-28 12:36:27
【问题描述】:
我是 JSON 数据的新手,所以请帮帮我!! 我有多个表单的单个网页,这些表单使用 angularjs 进行验证, 我想为该表单中的字段生成 JSON 数据。那么应该使用哪些方法来生成 JSON 数据并为该方法发布语法。
我的html代码是这样的
<td >
<input type="text" style="width:100px" ng-model="cost" ng-disabled="status!=true" required>
</td>
<td >
<input type="text" style="width:110px" ng-model="price" ng-disabled="status!=true" required>
</td>
我的 angularjs 代码是
var validationApp = angular.module('validationApp', ['ngFlag']);
// create angular controller
validationApp.controller('mainController', function($scope) {
$scope.style
{
$scope.buttonCSS= "clicked";
};
$scope.style2
{
}
$scope.invoice = {
items: [{
loyality: [{name:'points'},{name:'credits'}],
value:0,
period: [{name:'activity1'},{name:'activity2'}]
}],
items1:[{currency: [{name:'point'},{name:'credit'}], value1:0 }]
};
});
【问题讨论】: