Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.
This repository was archived by the owner on May 21, 2025. It is now read-only.

InitialValue fires one time #482

Description

@bonucci

I notice after i populate data from one input to another, the initialValue only fires one time when is empty, is like after is filled, if the $scope.test value is changed after the operating_airline input doesnt change anymore.

controller:

$scope.automaticFill = function(){
    var str = $scope.claim.flight_details.flight_code;
if(str.length >= 2){
          console.log("Im changed");
       $http.get('data/airlines-companies.json').then(function(response){
           
        var airlines = response.data; 
           
            airlines.forEach(function(code) {
            if(code.code_airline === str.toString().substring(0, 2).toUpperCase())
             $scope.test = code;
            });
        });
          
      }
};    
    

Html:

<input type="text" 
                               class="form-control" 
                               ng-model="claim.flight_details.flight_code" 
                               name="flight_code" 
                               id="flight_code"
                               ng-change="automaticFill()">

<div angucomplete-alt
                                  local-search="tap"
                                 id="operating_airline"
                                 placeholder="Search airline"
                                 pause="100"
                                 selected-object="claim.flight_details.operating_airline"
                                 local-data="airlines"
                                 search-fields="label"
                                 title-field="label"
                                 minlength="1"
                                 input-name="operating_airline"
                                 input-class="form-control form-control-small"
                                 match-class="highlight"
                                 field-required="true"
                                 initial-value="test">

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions