javascript - How to `update` new value choosing from `select box` on click save button? -


how update new value choosing select box on click save button.

i using ng-click function in js function update button:

   $scope.updatedealdetail = function updatedealdetail (){       $scope.showeditview = !$scope.showeditview;       $scope.dealdetail.decisionmakerdetail.email = $scope.selectedid;    } 

my function edit button:

$scope.edituserdetail = function edituserdetail(){         $scope.showeditview = !$scope.showeditview;         $scope.showsubmitview = !$scope.showsubmitview;         deal.getiddata($scope.accountdetail. accountusers[0].role,$scope.accountdetail.id).then(function successcb(data){           $scope.editidoptionsdata=data;           $scope.selectedid = $scope.editidoptionsdata[0].email;       });     }; 

and html bitton click :

<select ng-model="selectedid" class="form-control">    <option ng-selected="selectedid" ng-repeat="eiod in editidoptionsdata" value="{{eiod.email}}">{{eiod.email}} 

<button ng-click="updatedealdetail(eoid.email)" ng-disabled="dealdatasavebuttondisabled">update</button>  

i trying through ng-repeat because of using ng-options data through api showing in box. data on first index getting set. set default value selection box , selection value, onclick need update value.

don't use ngrepeat render options, problem. correct code be:

<select class="form-control"          ng-model="selectedid"          ng-options="eiod.email eiod.email eiod in editidoptionsdata"> </select> 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -