AngularJs generation json dynamically of the 2nd forms



  • http://plnkr.co/edit/jsiVpVMtKzgmA0hI5KE1?p=preview

    There are two types of forms submitted by the directive <add-form/> and <result-form/> by means of templates, each type is issued by the ng-repeat directive. The first type of form contains the title of arguments (number of forms - number of arguments) The second type of form is the meaning of these arguments and the result that corresponds to these values. It's a form for some tests, and their numbers can be different. How do we record the values from several forms of second type in json to variable value and results, as in the example above?

    Changed the example a little. Decided the question. resultsThere's a problem. value♪ http://plnkr.co/edit/jsiVpVMtKzgmA0hI5KE1?p=preview

    <div ng-repeat="unit in units track by $index">
        <result-form/>
    </div>
    

    Where? <result-form/> That's it.

    <div ng-repeat="arg in args track by $index">
              <div class="col-lg-3  value">
                  <input type="text" class="form-control" placeholder="Argument value" ng-model="arg.value[$parent.$index]" required>
              </div>
            </div>
    

    How to do it $scope.args variables value added value without index as in cryptic введите сюда описание изображения



  • For value: '' Use it. value: []




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2