angular.js, can't edit dynamically created input fields

后端 未结 3 2107
梦如初夏
梦如初夏 2021-01-02 00:58

Using angular.js, I have a dynamic list of form fields I want to display to the user for editing (and later submission):

var app = angular.module(\'app\', []         


        
3条回答
  •  情书的邮戳
    2021-01-02 01:18

    You need to use an array of objects. Hopefully you can rework your model:

    $scope.fields = [
       {label: "foo", value: "foov"},
       {label: "bar", value: "barv"},
       {label: "baz", value: "bazv"}
    ];
    
    
      {{field.label}}:
      
    

    Fiddle.

提交回复
热议问题