title: Different way of data binding
body: <p>I have a json file with 200 questions and answers. User should go through it and translate them. Structure of json file looks like this:</p>
  
  <pre><code>categoryName": "Name of Category",
  "questions": [
  {
    "questionName": "date",
    "questionField": "dateOfInspection",
    "questionRequired": "1",
    "questionType": "datefield",
    "questionLabel": "Date",
    "answers": [
      {
        "answerName": "date",
        "answerType": "datefield"
      }
    ]
  },
  {
    "questionName": "dealer",
    "questionField": "dealer",
    "questionRequired": "1",
    "questionType": "textfield",
    "questionLabel": "Dealer",
    "answers": [
      {
        "answerName": "dealer",
        "answerType": "textfield",
        "answerDescription": "Description Text"
      }
    ]
  }
  </code></pre>
  
  <p>I display all questions as a form on page:</p>
  
  <pre><code>&lt;form name="questionnaireSubmit" action=""  id="q" ng-click="submit()" novalidate&gt;
              &lt;div ng-repeat="categoryNQuestions in questionnaireFull"&gt;
                  &lt;p id="categoryName" &gt;
                      {{categoryNQuestions.categoryName}}
                  &lt;/p&gt;
  
                  &lt;div ng-repeat="question in categoryNQuestions.questions" id="questionAnswer"&gt;
                      &lt;label id="question"&gt;
                          {{question.questionField}}
                      &lt;/label&gt;
                      &lt;input type="text" class="form-control" ng-model="ctrl.qs.questionField" name="{{question.questionField}}" placeholder ="{{question.questionField}}" /&gt;
  
                      &lt;div ng-show="question.questionDescription"&gt;
                          &lt;label id="description"&gt;
                              {{question.questionDescription}}
                          &lt;/label&gt;
                          &lt;input type="text" class="form-control" name="{{question.questionDescription}}" /&gt;
                      &lt;/div&gt;
  
  
  
              &lt;input type="submit" value="Save" id="submit_btn" class="center-block" &gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>When user press submit button I want to generate new json object with translated questions and answers. 
  But two way data binding doesn't work here, because I have around 200 questionField fields and <code>ng-model</code> doesn't accept {{questionField}}.</p>
  
  <p>How can I bind data in other way?</p>
  
  <p>My controller:</p>
  
  <pre><code>var app = angular.module('questionnaire', []);
  app.controller('myQuestionCtrl', function($scope, $location, $http, $window) {
  
      var that=this;
      //$scope.question; 
  
  
  $http.get("json_file_url")
      .then(function(response) {
  
      $scope.questionnaireFull = {};
  
      $scope.questionnaireFull = response.data.categories;
  
  
  
      //create new questionnaire with cleared q_labels, q_descriptions, a_labels and a_descriptions
  
  
  
      $scope.questionnaireEmptyDuplicate = angular.copy(response.data);
  
  
  
      for (var i = 0; i &lt; $scope.questionnaireEmptyDuplicate.categories.length; i++){
          var caregories = $scope.questionnaireEmptyDuplicate.categories[i];
  
          for (var j = 0; j&lt; caregories.questions.length; j++){
              var questions = caregories.questions[j];
  
  
              if (angular.isUndefinedOrNull(questions.questionLabel) === false) {
                  questions.questionLabel = angular.clearValue(questions.questionLabel);
              }
  
              if (angular.isUndefinedOrNull(questions.questionDescription) === false) {
                  questions.questionDescription = angular.clearValue(questions.questionDescription);
              }
  
              angular.forEach(questions.answers, function(answer_value, answer_key) {
  
                  if (angular.isUndefinedOrNull(questions.questionDescription) === false) {
                      answer_value.answerLabel = angular.clearValue(answer_value.answerLabel);
                  }
  
                  if (angular.isUndefinedOrNull(questions.questionDescription) === false) {
                      answer_value.answerDescription = angular.clearValue(answer_value.answerDescription);
                  }
  
              })
  
  
          }
  
      }
  
      console.log($scope.questionnaireEmptyDuplicate);
  
  
  
  });  /*end of $http.get*/
  
  
  
  
  $scope.submit = function () { 
      alert("function is working"); //Add this line to your code to confirm your function is called.
      $window.location.href = "https://www.google.de/";
  
  } 
  
  
  //functions
  angular.isUndefinedOrNull  = function(val) {
      return angular.isUndefined(val) || val === null 
  }
  
  angular.clearValue = function(val){
      val = '';
      return val;
  }
  
  });
  </code></pre>