Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angucomplete #499

Open
dekhosla opened this issue Jun 27, 2017 · 0 comments
Open

Angucomplete #499

dekhosla opened this issue Jun 27, 2017 · 0 comments

Comments

@dekhosla
Copy link

    <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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant