ghiden / angucomplete-alt

Autocomplete Directive for AngularJS. A fork of Daryl Rowland's angucomplete (https://github.com/darylrowland/angucomplete) with some extra features.
https://ghiden.github.io/angucomplete-alt
MIT License
943 stars 496 forks source link

Angucomplete #499

Open dekhosla opened 7 years ago

dekhosla commented 7 years ago
    <tr> 
                    <td>
                        <button class="" ng-click="addNewbuild()">Add Building-Test</button>
                    </td>

                    <td> 
                        <div data-ng-repeat="build in additionalB">
                             <div class="row">
                                 <div class="col-sm-3">

                                        <angucomplete-alt id="e1" placeholder="Type Bldg Number Here" pause="100" maxlength="50" selected-object="selectedBuilding" initial-value="{{build.BLDG_NBR}}" local-data="myBuilding" description-field="NAME"
                                                       search-fields="BLDG_NBR" title-field="BLDG_NBR" minlength="1" input-class="form-control form-control-small" match-class="highlight"></angucomplete-alt>
                                         </div>
                                 <div class="col-md-6">
                                   <input class="form-control" type="text" ng-model="selectedBuilding.originalObject.NAME" ng-change="createSubject()" placeholder="{{build.BLDGNAME}}" maxlength="50" /></div>
                                     <button class="remove" ng-show="$last" ng-click="removebuilding()">x</button>
                                                           </div>

                              </div>

                            </td>
                </tr>

//Controller $http.get(settings.WebApiBaseUrl + 'api/bldg/' + myID) .success(function (data) {

                     //This addtionalB use for Additional Building
                     $scope.additionalB = data;

                 }).error(function (data, status, headers, config) {
                     alert("error:" + status);
                 })
             $scope.showBuilding = function () {
                 console.log($scope.selectedBuilding.originalObject.NAME);
                 console.log($scope.selectedBuilding.originalObject.BLDG_NBR);
                 $scope.edit25 = $scope.selectedBuilding.originalObject.NAME;
                 $scope.edit1 = $scope.selectedBuilding.originalObject.BLDG_NBR;
             }

$scope.addNewbuild = function () { var newItemNo = $scope.additionalB.length + 1; { $scope.additionalB.push({ ALERTID: +myID }); } console.log($scope.additionalB)

             };
             $scope.removebuilding = function () {
                 var lastItem = $scope.additionalB.length - 1;
                 $scope.additionalB.splice(lastItem);
             }

I have issue with angucomplete-alt. I want to use additional fields and autocomplete alt. But I Can't display my value in controller. So that i can Post value on API.