Below is an array containing objects:
//Data source code
$scope.data = [
{
name: 'Lname',
items: [{
label: 'Lastname',
type: 'text',
model: 'lname',
pattern: '/^[a-zA-Z]$/',
required: true
}]
},
{
name: 'Fname',
items: [{
label: 'Firstname',
type: 'text',
model: 'fname',
pattern: '/^[a-zA-Z]$/',
required: true
}]
}];
This is how the form should be displayed in the view:
<form class="form-horizontal" name="editForm" novalidate>
<div ng-repeat="elements in data">
<div class="form-group-sm has-feedback" ng-repeat="el in elements.items">
<label class="control-label">{{el.label}}</label>
<input type="{{el.type}}"
class="form-control"
placeholder="{el.label}"
ng-model="selected.[el.model]"
ng-pattern="el.pattern"
ng-required="el.required"
/>
The issue currently faced is that only the label is being displayed correctly while other variables are not. What could be causing this problem?