angularjs - How to bind the Id of a select box selection -


I have a select box that displays GeoAreaName, to populate the input field I have selected GeoAreaId the wanted. I have done something similar with type Ahead input but I am unable to apply it here

  & lt; Label & gt; Geographic & amp; Nbsp; Region: & lt; / Labels & gt; & Lt; Ng-Select Controller = "JobMiscCtrl" ng-model = "currentItem.GeoAreaName" ng-option = "Job. GeoAreaArray for Job GeoAreaName" & gt; & Lt; Option value = "" & gt; & Lt; / Options & gt; & Lt; / Select & gt; & Lt; Input type = "number" ng-model = "present itam.goariaid" />    

I have edited your plunker

You had two problems.

  • Your input field was outside the scope of your NG-controller declaration
  • Your nG-option expression should be slightly different & lt; Select ng-model = "currentItem" ng-option = "job.GeoAreaId jobs. GeoAreaNrame for job in GeoAreaArray" & gt; & Lt; Option value = "" & gt; & Lt; / Options & gt; & Lt; / Select & gt;

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -