2017-08-24 4 views
0

Wie könnte ich zwei Autovervollständigen erstellen, die von einer anderen Autovervollständigung abhängig sind. ich habe meinen Code versucht gegeben unterWie man den Wert einer Autovervollständigung in Abhängigkeit von einer anderen Autovervollständigung in angular2 ändert

<div class="col-md-4 xs-p1"> 
         <div class="form-group"> 
          <label>City <em>*</em></label> 
          <input ng2-auto-complete [(ngModel)]="contact.pCity" [source]="citySuggestions.bind(this)" 
           list-formatter="pCity" display-property-name="pCity" placeholder="Search by City" 
           class="form-control1" style="border-radius:0px"> 
          <!--<input class="form-control1" id="height2" placeholder="Enter City" type="text" [(ngModel)]="contact.pCity">--> 
         </div> 

        </div> 
        <div class="col-md-4 xs-p1"> 
         <div class="form-group"> 
          <label>State <em>*</em></label> 
          <input ng2-auto-complete [(ngModel)]="contact.pState" [source]="codeSuggestions.bind(this)" 
           list-formatter="pState" display-property-name="pState" placeholder="Search by State" 
           class="form-control1" style="border-radius:0px" (valueChanged)="getCitySuggestions($event)" max-num-list="5"> 
         </div> 
        </div> 

dies funktionierte nicht bitte helfen. Gibt es Link avable für diese

Antwort

0

Könnten Sie getCitySuggestions Funktion bereitstellen?
.bind (this) ist unnötig

Verwandte Themen