我是JSON數據的新手,請幫助我! 我有單一的網頁與多個形式,這是驗證使用angularjs, 我想生成的JSON數據的字段在該窗體中。哪些方法應該用來生成JSON數據併發布該方法的語法。如何爲angularjs中的表單字段生成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 }]
};
});