how to store html 'select' control input to the JSON object using ng-model in AngularJS? -


I am forced to select 'selection' input control in each row using ng-repeat. After binding, I want to store the selected value

My code:

  & lt; Table & gt; For 'Selection' control on JSON object using 'ng-model.how'? In the item & lt; Tr ng-repeat = "(breakfast, price)" & gt; & Lt; TD & gt; & Lt; Label & gt; {{Refreshments}} & lt; / Labels & gt; & Lt; / TD & gt; & Lt; Td style = "padding-left: 500px" & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt; Label & gt; {{Price}} & lt; / Labels & gt; & Lt; / TD & gt; & Lt; Td square = "td_width" & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt; Select ng-model = "Quantity" & gt; & Lt; Option value = "0" & ​​gt; 0 & lt; / Options & gt; & Lt; Option value = "1" & gt; 1 & lt; / Options & gt; & Lt; Option value = "2" & gt; 2 & lt; / Options & gt; & Lt; Option value = "3" & gt; 3 & lt; / Options & gt; & Lt; Option value = "4" & gt; 4 & lt; / Options & gt; & Lt; / Select & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt;   

JSON object:

  var JSONObject = {"Quantity": "{{quantity}}"};   

Just need to force the volume selected in the JSON object. I have one row more than my ng-repeat & amp; For each line, I am compiling the selection option through NG-Repeat.

Thank you in advance, Stephen. L

do this:

  var JSONObject = {}; JSONObject.quantity = scope.quantity;    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -