AngularJS Example:
by alepkowski
HTML
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<div ng-app>
<div ng-controller="TestCtrl">
<form id="fmsubmit" role="form" ng-init="row={}">
<div class="form-group" ng-repeat="(key, value) in showCase.person" ng-init="row[key]=value">
<label for="{{key}}">{{key}}</label>
<input type="text" class="form-control" id="{{key}}" ng-disabled="key=='rowId'" placeholder="{{key}}" name="{{key}}" ng-model="row[key]" />
</div>
<button type="submit" ng-click="showCase.submitData(row)" class="btn btn-default">Submit</button>
</form>
</div>
</div>
CSS
.done-true {
text-decoration: line-through;
color: grey;
}
JavaScript
function TestCtrl($scope) {
$scope.showCase = {};
$scope.showCase.person = {
"id": 2,
"project": "wewe2012",
"date": "2013-02-26",
"description": "ewew",
"eet_no": "ewew",
};
$scope.showCase.submitData = function (person) {
console.log(person);
alert(JSON.stringify(person));
};
}