0

I am creating template including TypeaHead boxes using ng-repeat on the basis of json data and I am giving dynamic model names to the boxes. My html part for TypeaHead box is:-

    <div ng-if="object.typeahead != undefined">
            <label style="float:left;">{{ object.label }}</label>
            <input class="form-control" type="text" ng-model="selectedTypeaHead[$index]" disabled/>
            <input class="form-control" type="text"  typeahead-on-select="setType($index, $item)" ng-model="selected" typeahead="val.value for val in values | filter:$viewValue" />
   </div>

Now, in my controller I want to insert the selected value of select box into the input box: selectedTypeaHead[$index] not selectedTypeaHead. Please help me. Thanks in advance.

    $scope.setType = function(index, item) {
        alert(index);
        $scope.selectedTypeaHead = item.value+','+item.id;
    }
Muhammad Umar
  • 349
  • 3
  • 14

0 Answers0