angularjs - Set custom id in ng-options -
I am using Kazun to create a selection using ng-options, and all working from zero I'm going to want to set it to the angular auto-populate value instead.
$ scope.form.stage = [[Optional: 1 ID: 23 Description: UD Visual Inspection - Optional), {Optional: 0 ID: 12 Description: Flash}] My Instructions: & lt; Select name = 'test_stage' ng-model = 'Form.selectedStage' ng-change = 'abc (form)' ng-options = 'form.stage for item in item.esage' & gt; HTML provided : & lt; Choose name = "test_stage" id = "test_form_stage" tabindex = "2" ng -model = "form.Selected stag" ng-change = "ABC (form)" ng-option = "description form in item.stage" NG-Blur = "Fetch teststation (form)" class = "ng-valid ng -dirty" & gt; Option value = "0" & gt; UD Visual Inspection - Optional & lt; / Option & gt; & Lt; Option value = "1" & gt; Flash & lt; / Option & gt; & Lt; / Select & gt; Instead of setting values to 0 and 1, I want 23 and 12 ...
Updated HTML: < / P> & lt; Select name = "test_stage" id = "test_form_stage" tabindex = "2" ng-model = "form.selectedStage" ng-change = "ABC (form)" ng-option = "item to item as item. Escript.stage "ng-blur =" fetchTestStation (form) "item = class =" ng-valid ng-dirty "& gt; & Lt; Option value = "0" & gt; UD Visual Inspection - Optional & lt; / Option & gt; & Lt; Option value = "1" & gt; Flash & lt; / Option & gt; & Lt; / Select & gt; Updated: 7-25-15 Form: {selectedStage: null stage: [[Optional: 1 ID: 23 $ 3 $ Description: UD Visual Inspection - Optional}, {Optional: 0 ID: 13 Description: Engraving}}} Selected Step: {$ ref: $ ["form"] ["stage"] [1]} Generated HTML & lt; Name name = "test_stage" id = "test_form_stage" tabindex = "2" ng-model = "form.selectedStage" ng-options = "item.escript form as item.description "Ng-blur =" fetchTestStation (form) "class =" ng-valid ng-dirty "& gt; & Lt; Option value = "?" & Gt; & Lt; / Options & gt; Option value = "0" & gt; UD Visual Inspection - Optional & lt; / Option & gt; & Lt; Option value = "1" & gt; Engraved & lt; / Option & gt; & Lt; / Select & gt; MySQL {}; $ Scope.product = {}; // Set request for sending paramars var params = $ .param ({serial: $ scope.serial}); / ** * Get platform data for serial from API [Factory] * / tstFrmServices.locateRecord (params) .success (function (result) {$ scope.data = result.data; // handle successfully response ($ scope .data ['success'] [0] .code == 200) {$ scope.form = {{} Step: blank, step: $ scope.data ['success'] [0] .data; $ scope.workorder = $ Scope .data ['success'] [0] .2; $ scope.product = $ scope.data ['success'] [0] .product;}}). Error (function (result) {}); }; });
Data returned from factory "data": [{"alternate", "description": "UD visual inspection - Optional "}, {" optional ": 0," id ": 13," description ":" engraving "}]," product ":" 10P91685-010 "}]
If you select selectedStage , the entire selected object, you
Comments
Post a Comment