angularjs - fetching data from a dynamic form in angular js -
i've got json file generates form definitions each specific form. in view - spit out data
<input ng-data-model="data[value2.id]" placeholder="{{value2.label}}" type="text" /> <button ng-click="send_form()" >submit</button>
in controller, i've got following function
$scope.send_form = function() { alert($scope.data); }
when send_form function called - "undefined" returned back. question is, how handle dynamic form data in angular js , each of values inserted user? there way key/value pair set of data returned? ng-data-model has key , value inserted user user? or how handle specific scenario? :)
thanks :)
it's ng-model
bind input scope variable. or can use data-ng-model compliance. other should work if data set - might show example of how looks.
here's fiddle dummy data: https://jsfiddle.net/ba0pj6sv/
Comments
Post a Comment