JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-controller="MyController">
<form name="myForm">
<div ng-repeat="question in questions">
<input type="text" name="{{question.name}}" ng-model="question.value">
</div>
<button ng-click="submit()">Submit</button>
</form>
</div>
JavaScript
angular.module('myApp', []);
function MyController($scope) {
$scope.questions = [
{
'name': 'question1',
'label': 'Question 1',
'value': null
},
{
'name': 'question2',
'label': 'Question 2',
'value': null
}
];
$scope.submit = function() {
console.log('$scope.myForm', $scope.myForm);
};
};