Angular: Dynamic form fields
http://angularjs.org/
HTML
<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<div ng-controller="MyCtrl">
<div ng-repeat="input in config" style="border: 1px solid #000;">
<div ng-repeat="inputProperty in input.inputStyle" style="border: 1px solid #000;">
<input type="text" style="{{inputProperty.style}}" ng-model="loop.year">Type in Year</div>
</div>
<div ng-repeat="book in products | filter: loop.year">{{ book.bookname }}</div>
</div>
JavaScript
var myApp = angular.module('myApp', [])
.filter('filterValues', function () {
return function (items, fieldData, fields, product) {
}
});
function MyCtrl($scope) {
$scope.products = [{
"bookname": "harryporter",
"year": "2000"
}, {
"bookname": "Sleepless",
"year": "2003"
}];
$scope.config = [{
"Title": "YearInput",
"width": "100",
"inputStyle": [{
"style": "background-color:green;"
}]
}];
};