I am currently working on an AngularJS application where I use $scope.forms
to generate various input fields in the HTML section through ng-repeat
.
One thing that is puzzling me is how to populate the values: []
with data from the
attributes: ["title", "firstname", "lastname", "address"]
inputs.
Could someone please help me understand how to transfer the input values into the values key? Or is there a more efficient solution you could suggest?
function sampleCtrl($scope) {
$scope.forms = [
{
title: "Something",
attributes: ["title", "firstname", "lastname", "address"],
values: [] //I need the values from the attributes here
},
{
title: "Something else",
attributes: ["title", "name", "job", "address"],
values: [] //I need the values from the attributes here
} ]; }